model_packages
Creates, updates, deletes or gets a model_package resource or lists model_packages in a region
Overview
| Name | model_packages |
| Type | Resource |
| Description | Resource Type definition for AWS::SageMaker::ModelPackage |
| Id | awscc.sagemaker.model_packages |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
tags | array | An array of key-value pairs to apply to this resource. |
additional_inference_specifications | array | An array of additional Inference Specification objects. |
certify_for_marketplace | boolean | Whether to certify the model package for listing on AWS Marketplace. |
client_token | string | A unique token that guarantees that the call to this API is idempotent. |
customer_metadata_properties | object | The metadata properties associated with the model package versions. |
domain | string | The machine learning domain of the model package you specified. |
drift_check_baselines | object | Represents the drift check baselines that can be used when the model monitor is set using the model package. |
inference_specification | object | Details about inference jobs that can be run with models based on this model package. |
metadata_properties | object | Metadata properties of the tracking entity, trial, or trial component. |
model_approval_status | string | The approval status of the model package. |
model_metrics | object | A structure that contains model metrics reports. |
model_package_description | string | The description of the model package. |
model_package_group_name | string | The name of the model package group. |
model_package_name | string | The name or arn of the model package. |
sample_payload_url | string | The Amazon Simple Storage Service (Amazon S3) path where the sample payload are stored pointing to single gzip compressed tar archive. |
skip_model_validation | string | Indicates if you want to skip model validation. |
source_algorithm_specification | object | Details about the algorithm that was used to create the model package. |
task | string | The machine learning task your model package accomplishes. |
validation_specification | object | Specifies configurations for one or more transform jobs that Amazon SageMaker runs to test the model package. |
model_package_arn | string | The Amazon Resource Name (ARN) of the model package group. |
approval_description | string | A description provided for the model approval. |
creation_time | string | The time at which the model package was created. |
last_modified_time | string | The time at which the model package was last modified. |
model_package_status | string | The current status of the model package. |
model_package_version | integer | The version of the model package. |
model_package_status_details | object | Details about the current status of the model package. |
source_uri | string | The URI of the source for the model package. |
model_card | object | The model card associated with the model package. |
security_config | object | An optional AWS Key Management Service key to encrypt, decrypt, and re-encrypt model package information for regulated workloads with highly sensitive data. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
model_package_arn | string | The Amazon Resource Name (ARN) of the model package group. |
region | string | AWS region. |
For more information, see AWS::SageMaker::ModelPackage.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | model_packages | INSERT | region |
delete_resource | model_packages | DELETE | Identifier, region |
update_resource | model_packages | UPDATE | Identifier, PatchDocument, region |
list_resources | model_packages_list_only | SELECT | region |
get_resource | model_packages | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual model_package.
SELECT
region,
tags,
additional_inference_specifications,
certify_for_marketplace,
client_token,
customer_metadata_properties,
domain,
drift_check_baselines,
inference_specification,
metadata_properties,
model_approval_status,
model_metrics,
model_package_description,
model_package_group_name,
model_package_name,
sample_payload_url,
skip_model_validation,
source_algorithm_specification,
task,
validation_specification,
model_package_arn,
approval_description,
creation_time,
last_modified_time,
model_package_status,
model_package_version,
additional_inference_specifications_to_add,
model_package_status_details,
source_uri,
model_card,
security_config
FROM awscc.sagemaker.model_packages
WHERE
region = 'us-east-1' AND
Identifier = '{{ model_package_arn }}';
Lists all model_packages in a region.
SELECT
region,
model_package_arn
FROM awscc.sagemaker.model_packages_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new model_package resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.sagemaker.model_packages (
Tags,
AdditionalInferenceSpecifications,
CertifyForMarketplace,
ClientToken,
CustomerMetadataProperties,
Domain,
DriftCheckBaselines,
InferenceSpecification,
MetadataProperties,
ModelApprovalStatus,
ModelMetrics,
ModelPackageDescription,
ModelPackageGroupName,
ModelPackageName,
SamplePayloadUrl,
SkipModelValidation,
SourceAlgorithmSpecification,
Task,
ValidationSpecification,
ApprovalDescription,
LastModifiedTime,
ModelPackageVersion,
AdditionalInferenceSpecificationsToAdd,
ModelPackageStatusDetails,
SourceUri,
ModelCard,
SecurityConfig,
region
)
SELECT
'{{ tags }}',
'{{ additional_inference_specifications }}',
'{{ certify_for_marketplace }}',
'{{ client_token }}',
'{{ customer_metadata_properties }}',
'{{ domain }}',
'{{ drift_check_baselines }}',
'{{ inference_specification }}',
'{{ metadata_properties }}',
'{{ model_approval_status }}',
'{{ model_metrics }}',
'{{ model_package_description }}',
'{{ model_package_group_name }}',
'{{ model_package_name }}',
'{{ sample_payload_url }}',
'{{ skip_model_validation }}',
'{{ source_algorithm_specification }}',
'{{ task }}',
'{{ validation_specification }}',
'{{ approval_description }}',
'{{ last_modified_time }}',
'{{ model_package_version }}',
'{{ additional_inference_specifications_to_add }}',
'{{ model_package_status_details }}',
'{{ source_uri }}',
'{{ model_card }}',
'{{ security_config }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.sagemaker.model_packages (
Tags,
AdditionalInferenceSpecifications,
CertifyForMarketplace,
ClientToken,
CustomerMetadataProperties,
Domain,
DriftCheckBaselines,
InferenceSpecification,
MetadataProperties,
ModelApprovalStatus,
ModelMetrics,
ModelPackageDescription,
ModelPackageGroupName,
ModelPackageName,
SamplePayloadUrl,
SkipModelValidation,
SourceAlgorithmSpecification,
Task,
ValidationSpecification,
ApprovalDescription,
LastModifiedTime,
ModelPackageVersion,
AdditionalInferenceSpecificationsToAdd,
ModelPackageStatusDetails,
SourceUri,
ModelCard,
SecurityConfig,
region
)
SELECT
'{{ tags }}',
'{{ additional_inference_specifications }}',
'{{ certify_for_marketplace }}',
'{{ client_token }}',
'{{ customer_metadata_properties }}',
'{{ domain }}',
'{{ drift_check_baselines }}',
'{{ inference_specification }}',
'{{ metadata_properties }}',
'{{ model_approval_status }}',
'{{ model_metrics }}',
'{{ model_package_description }}',
'{{ model_package_group_name }}',
'{{ model_package_name }}',
'{{ sample_payload_url }}',
'{{ skip_model_validation }}',
'{{ source_algorithm_specification }}',
'{{ task }}',
'{{ validation_specification }}',
'{{ approval_description }}',
'{{ last_modified_time }}',
'{{ model_package_version }}',
'{{ additional_inference_specifications_to_add }}',
'{{ model_package_status_details }}',
'{{ source_uri }}',
'{{ model_card }}',
'{{ security_config }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: model_package
props:
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: additional_inference_specifications
value:
- containers:
- container_hostname: '{{ container_hostname }}'
environment: {}
model_input:
data_input_config: '{{ data_input_config }}'
image: '{{ image }}'
image_digest: '{{ image_digest }}'
model_data_url: '{{ model_data_url }}'
model_data_source:
s3_data_source:
s3_data_type: '{{ s3_data_type }}'
s3_uri: '{{ s3_uri }}'
compression_type: '{{ compression_type }}'
model_access_config:
accept_eula: '{{ accept_eula }}'
framework: '{{ framework }}'
framework_version: '{{ framework_version }}'
nearest_model_name: '{{ nearest_model_name }}'
description: '{{ description }}'
name: '{{ name }}'
supported_content_types:
- '{{ supported_content_types[0] }}'
supported_realtime_inference_instance_types:
- '{{ supported_realtime_inference_instance_types[0] }}'
supported_response_mi_me_types:
- '{{ supported_response_mi_me_types[0] }}'
supported_transform_instance_types:
- '{{ supported_transform_instance_types[0] }}'
- name: certify_for_marketplace
value: '{{ certify_for_marketplace }}'
- name: client_token
value: '{{ client_token }}'
- name: customer_metadata_properties
value: {}
- name: domain
value: '{{ domain }}'
- name: drift_check_baselines
value:
bias:
post_training_constraints:
content_digest: '{{ content_digest }}'
content_type: '{{ content_type }}'
s3_uri: '{{ s3_uri }}'
pre_training_constraints: null
config_file:
content_digest: '{{ content_digest }}'
content_type: '{{ content_type }}'
s3_uri: '{{ s3_uri }}'
explainability:
constraints: null
config_file: null
model_data_quality:
constraints: null
statistics: null
model_quality:
constraints: null
statistics: null
- name: inference_specification
value:
containers:
- null
supported_content_types:
- null
supported_realtime_inference_instance_types:
- null
supported_response_mi_me_types:
- null
supported_transform_instance_types:
- null
- name: metadata_properties
value:
commit_id: '{{ commit_id }}'
generated_by: '{{ generated_by }}'
project_id: '{{ project_id }}'
repository: '{{ repository }}'
- name: model_approval_status
value: '{{ model_approval_status }}'
- name: model_metrics
value:
bias:
report: null
pre_training_report: null
post_training_report: null
explainability:
report: null
model_data_quality:
constraints: null
statistics: null
model_quality:
constraints: null
statistics: null
- name: model_package_description
value: '{{ model_package_description }}'
- name: model_package_group_name
value: '{{ model_package_group_name }}'
- name: model_package_name
value: '{{ model_package_name }}'
- name: sample_payload_url
value: '{{ sample_payload_url }}'
- name: skip_model_validation
value: '{{ skip_model_validation }}'
- name: source_algorithm_specification
value:
source_algorithms:
- algorithm_name: '{{ algorithm_name }}'
model_data_url: '{{ model_data_url }}'
- name: task
value: '{{ task }}'
- name: validation_specification
value:
validation_profiles:
- transform_job_definition:
environment: null
batch_strategy: '{{ batch_strategy }}'
max_concurrent_transforms: '{{ max_concurrent_transforms }}'
max_payload_in_mb: '{{ max_payload_in_mb }}'
transform_input:
compression_type: '{{ compression_type }}'
content_type: '{{ content_type }}'
data_source:
s3_data_source:
s3_data_type: '{{ s3_data_type }}'
s3_uri: '{{ s3_uri }}'
split_type: '{{ split_type }}'
transform_output:
accept: '{{ accept }}'
kms_key_id: '{{ kms_key_id }}'
s3_output_path: '{{ s3_output_path }}'
assemble_with: '{{ assemble_with }}'
transform_resources:
instance_count: '{{ instance_count }}'
instance_type: '{{ instance_type }}'
volume_kms_key_id: '{{ volume_kms_key_id }}'
profile_name: '{{ profile_name }}'
validation_role: '{{ validation_role }}'
- name: approval_description
value: '{{ approval_description }}'
- name: last_modified_time
value: '{{ last_modified_time }}'
- name: model_package_version
value: '{{ model_package_version }}'
- name: additional_inference_specifications_to_add
value: null
- name: model_package_status_details
value:
validation_statuses:
- failure_reason: '{{ failure_reason }}'
name: '{{ name }}'
status: '{{ status }}'
- name: source_uri
value: '{{ source_uri }}'
- name: model_card
value:
model_card_content: '{{ model_card_content }}'
model_card_status: '{{ model_card_status }}'
- name: security_config
value:
kms_key_id: '{{ kms_key_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a model_package resource, using stack-deploy.
/*+ update */
UPDATE awscc.sagemaker.model_packages
SET PatchDocument = string('{{ {
"Tags": tags,
"AdditionalInferenceSpecifications": additional_inference_specifications,
"CertifyForMarketplace": certify_for_marketplace,
"CustomerMetadataProperties": customer_metadata_properties,
"ModelApprovalStatus": model_approval_status,
"ModelPackageName": model_package_name,
"SkipModelValidation": skip_model_validation,
"ApprovalDescription": approval_description,
"LastModifiedTime": last_modified_time,
"ModelPackageVersion": model_package_version,
"AdditionalInferenceSpecificationsToAdd": additional_inference_specifications_to_add,
"ModelPackageStatusDetails": model_package_status_details,
"SourceUri": source_uri,
"ModelCard": model_card
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ model_package_arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.sagemaker.model_packages
WHERE
Identifier = '{{ model_package_arn }}' AND
region = 'us-east-1';
Permissions
To operate on the model_packages resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ecr:BatchGetImage,
ecr:DescribeImages,
ecr:StartImageScan,
ecr:DescribeImageScanFindings,
sagemaker:AddTags,
sagemaker:CreateModel,
sagemaker:CreateModelPackage,
sagemaker:CreateTrainingJob,
sagemaker:CreateTransformJob,
sagemaker:DescribeTransformJob,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
sagemaker:UpdateModelPackage,
iam:PassRole,
s3:GetObject,
s3:ListBucket,
kms:CreateGrant,
kms:DescribeKey,
kms:GenerateDataKey,
kms:Decrypt
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
kms:DescribeKey,
kms:Decrypt
ecr:BatchGetImage,
sagemaker:UpdateModelPackage,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
sagemaker:AddTags,
sagemaker:DeleteTags,
s3:GetObject,
s3:ListBucket,
kms:CreateGrant,
kms:DescribeKey,
kms:GenerateDataKey,
kms:Decrypt
sagemaker:DeleteModelPackage,
sagemaker:DescribeModelPackage,
kms:DescribeKey,
kms:Decrypt
sagemaker:ListModelPackages