Skip to main content

model_packages

Creates, updates, deletes or gets a model_package resource or lists model_packages in a region

Overview

Namemodel_packages
TypeResource
DescriptionResource Type definition for AWS::SageMaker::ModelPackage
Idawscc.sagemaker.model_packages

Fields

NameDatatypeDescription
tagsarrayAn array of key-value pairs to apply to this resource.
additional_inference_specificationsarrayAn array of additional Inference Specification objects.
certify_for_marketplacebooleanWhether to certify the model package for listing on AWS Marketplace.
client_tokenstringA unique token that guarantees that the call to this API is idempotent.
customer_metadata_propertiesobjectThe metadata properties associated with the model package versions.
domainstringThe machine learning domain of the model package you specified.
drift_check_baselinesobjectRepresents the drift check baselines that can be used when the model monitor is set using the model package.
inference_specificationobjectDetails about inference jobs that can be run with models based on this model package.
metadata_propertiesobjectMetadata properties of the tracking entity, trial, or trial component.
model_approval_statusstringThe approval status of the model package.
model_metricsobjectA structure that contains model metrics reports.
model_package_descriptionstringThe description of the model package.
model_package_group_namestringThe name of the model package group.
model_package_namestringThe name or arn of the model package.
sample_payload_urlstringThe Amazon Simple Storage Service (Amazon S3) path where the sample payload are stored pointing to single gzip compressed tar archive.
skip_model_validationstringIndicates if you want to skip model validation.
source_algorithm_specificationobjectDetails about the algorithm that was used to create the model package.
taskstringThe machine learning task your model package accomplishes.
validation_specificationobjectSpecifies configurations for one or more transform jobs that Amazon SageMaker runs to test the model package.
model_package_arnstringThe Amazon Resource Name (ARN) of the model package group.
approval_descriptionstringA description provided for the model approval.
creation_timestringThe time at which the model package was created.
last_modified_timestringThe time at which the model package was last modified.
model_package_statusstringThe current status of the model package.
model_package_versionintegerThe version of the model package.
model_package_status_detailsobjectDetails about the current status of the model package.
source_uristringThe URI of the source for the model package.
model_cardobjectThe model card associated with the model package.
security_configobjectAn optional AWS Key Management Service key to encrypt, decrypt, and re-encrypt model package information for regulated workloads with highly sensitive data.
regionstringAWS region.

For more information, see AWS::SageMaker::ModelPackage.

Methods

NameResourceAccessible byRequired Params
create_resourcemodel_packagesINSERTregion
delete_resourcemodel_packagesDELETEIdentifier, region
update_resourcemodel_packagesUPDATEIdentifier, PatchDocument, region
list_resourcesmodel_packages_list_onlySELECTregion
get_resourcemodel_packagesSELECTIdentifier, region

SELECT examples

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 = '{{ region }}' AND
Identifier = '{{ model_package_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new model_package resource, using stack-deploy.

/*+ 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.sagemaker.model_packages
WHERE
Identifier = '{{ model_package_arn }}' 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:

ParameterDescription
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_packages resource, the following permissions are required:

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