model_cards
Creates, updates, deletes or gets a model_card resource or lists model_cards in a region
Overview
| Name | model_cards |
| Type | Resource |
| Description | Resource Type definition for AWS::SageMaker::ModelCard. |
| Id | awscc.sagemaker.model_cards |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
model_card_arn | string | The Amazon Resource Name (ARN) of the successfully created model card. |
model_card_version | integer | A version of the model card. |
model_card_name | string | The unique name of the model card. |
security_config | object | An optional Key Management Service key to encrypt, decrypt, and re-encrypt model card content for regulated workloads with highly sensitive data. |
model_card_status | string | The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval. |
content | object | The content of the model card. |
creation_time | string | The date and time the model card was created. |
created_by | object | Information about the user who created or modified an experiment, trial, trial component, lineage group, project, or model card. |
last_modified_time | string | The date and time the model card was last modified. |
model_card_processing_status | string | The processing status of model card deletion. The ModelCardProcessingStatus updates throughout the different deletion steps. |
tags | array | Key-value pairs used to manage metadata for model cards. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
model_card_name | string | The unique name of the model card. |
region | string | AWS region. |
For more information, see AWS::SageMaker::ModelCard.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | model_cards | INSERT | ModelCardName, Content, ModelCardStatus, region |
delete_resource | model_cards | DELETE | Identifier, region |
update_resource | model_cards | UPDATE | Identifier, PatchDocument, region |
list_resources | model_cards_list_only | SELECT | region |
get_resource | model_cards | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual model_card.
SELECT
region,
model_card_arn,
model_card_version,
model_card_name,
security_config,
model_card_status,
content,
creation_time,
created_by,
last_modified_time,
last_modified_by,
model_card_processing_status,
tags
FROM awscc.sagemaker.model_cards
WHERE
region = '{{ region }}' AND
Identifier = '{{ model_card_name }}';
Lists all model_cards in a region.
SELECT
region,
model_card_name
FROM awscc.sagemaker.model_cards_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new model_card resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.sagemaker.model_cards (
ModelCardName,
ModelCardStatus,
Content,
region
)
SELECT
'{{ model_card_name }}',
'{{ model_card_status }}',
'{{ content }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.sagemaker.model_cards (
ModelCardName,
SecurityConfig,
ModelCardStatus,
Content,
CreatedBy,
LastModifiedBy,
Tags,
region
)
SELECT
'{{ model_card_name }}',
'{{ security_config }}',
'{{ model_card_status }}',
'{{ content }}',
'{{ created_by }}',
'{{ last_modified_by }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: model_card
props:
- name: model_card_name
value: '{{ model_card_name }}'
- name: security_config
value:
kms_key_id: '{{ kms_key_id }}'
- name: model_card_status
value: '{{ model_card_status }}'
- name: content
value:
model_overview:
model_description: '{{ model_description }}'
model_owner: '{{ model_owner }}'
model_creator: '{{ model_creator }}'
problem_type: '{{ problem_type }}'
algorithm_type: '{{ algorithm_type }}'
model_id: '{{ model_id }}'
model_artifact:
- '{{ model_artifact[0] }}'
model_name: '{{ model_name }}'
model_version: null
inference_environment:
container_image:
- '{{ container_image[0] }}'
model_package_details:
model_package_description: '{{ model_package_description }}'
model_package_arn: '{{ model_package_arn }}'
created_by:
user_profile_name: '{{ user_profile_name }}'
model_package_status: '{{ model_package_status }}'
model_approval_status: '{{ model_approval_status }}'
approval_description: '{{ approval_description }}'
model_package_group_name: '{{ model_package_group_name }}'
model_package_name: '{{ model_package_name }}'
model_package_version: null
domain: '{{ domain }}'
task: '{{ task }}'
source_algorithms:
- algorithm_name: '{{ algorithm_name }}'
model_data_url: '{{ model_data_url }}'
inference_specification:
containers:
- model_data_url: '{{ model_data_url }}'
image: '{{ image }}'
nearest_model_name: '{{ nearest_model_name }}'
intended_uses:
purpose_of_model: '{{ purpose_of_model }}'
intended_uses: '{{ intended_uses }}'
factors_affecting_model_efficiency: '{{ factors_affecting_model_efficiency }}'
risk_rating: '{{ risk_rating }}'
explanations_for_risk_rating: '{{ explanations_for_risk_rating }}'
business_details:
business_problem: '{{ business_problem }}'
business_stakeholders: '{{ business_stakeholders }}'
line_of_business: '{{ line_of_business }}'
training_details:
objective_function:
function:
function: '{{ function }}'
facet: '{{ facet }}'
condition: '{{ condition }}'
notes: '{{ notes }}'
training_observations: '{{ training_observations }}'
training_job_details:
training_arn: '{{ training_arn }}'
training_datasets:
- '{{ training_datasets[0] }}'
training_environment:
container_image:
- '{{ container_image[0] }}'
training_metrics:
- name: '{{ name }}'
notes: '{{ notes }}'
value: null
user_provided_training_metrics:
- null
hyper_parameters:
- name: '{{ name }}'
value: '{{ value }}'
user_provided_hyper_parameters:
- null
evaluation_details:
- name: '{{ name }}'
evaluation_observation: '{{ evaluation_observation }}'
evaluation_job_arn: '{{ evaluation_job_arn }}'
datasets:
- '{{ datasets[0] }}'
metadata: {}
metric_groups:
- name: '{{ name }}'
metric_data:
- null
additional_information:
ethical_considerations: '{{ ethical_considerations }}'
caveats_and_recommendations: '{{ caveats_and_recommendations }}'
custom_details: {}
- name: created_by
value:
user_profile_arn: '{{ user_profile_arn }}'
user_profile_name: '{{ user_profile_name }}'
domain_id: '{{ domain_id }}'
- name: last_modified_by
value: null
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a model_card resource, using stack-deploy.
/*+ update */
UPDATE awscc.sagemaker.model_cards
SET PatchDocument = string('{{ {
"ModelCardStatus": model_card_status,
"Content": content,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ model_card_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.sagemaker.model_cards
WHERE
Identifier = '{{ model_card_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the model_cards resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
sagemaker:CreateModelCard,
sagemaker:DescribeModel,
kms:DescribeKey,
kms:GenerateDataKey,
kms:CreateGrant,
sagemaker:DescribeModelPackageGroup,
sagemaker:DescribeModelPackage,
sagemaker:AddTags
sagemaker:DescribeModelCard,
sagemaker:DescribeModelPackageGroup,
sagemaker:DescribeModelPackage,
kms:Decrypt,
sagemaker:ListTags
sagemaker:UpdateModelCard,
sagemaker:DescribeModelCard,
sagemaker:DescribeModel,
kms:GenerateDataKey,
kms:Decrypt,
sagemaker:DescribeModelPackageGroup,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
sagemaker:AddTags,
sagemaker:DeleteTags
sagemaker:DescribeModelCard,
sagemaker:DeleteModelCard,
sagemaker:DescribeModelPackageGroup,
sagemaker:DescribeModelPackage,
kms:RetireGrant,
kms:Decrypt,
sagemaker:ListTags,
sagemaker:DeleteTags
sagemaker:ListModelCards,
sagemaker:ListModelCardVersions