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
Idaws.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.
additional_inference_specifications_to_addarrayAn array of additional Inference Specification objects.
model_package_status_detailsobjectDetails about the current status of the model package.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourceSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

List all model_packages in a region.

SELECT
region,
model_package_arn
FROM aws.sagemaker.model_packages
WHERE region = 'us-east-1';

Gets all properties from a 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
FROM aws.sagemaker.model_packages
WHERE region = 'us-east-1' AND data__Identifier = '<ModelPackageArn>';

INSERT example

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

/*+ create */
INSERT INTO aws.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,
region
)
SELECT
'{{ Tags }}',
'{{ AdditionalInferenceSpecifications }}',
'{{ CertifyForMarketplace }}',
'{{ ClientToken }}',
'{{ CustomerMetadataProperties }}',
'{{ Domain }}',
'{{ DriftCheckBaselines }}',
'{{ InferenceSpecification }}',
'{{ MetadataProperties }}',
'{{ ModelApprovalStatus }}',
'{{ ModelMetrics }}',
'{{ ModelPackageDescription }}',
'{{ ModelPackageGroupName }}',
'{{ ModelPackageName }}',
'{{ SamplePayloadUrl }}',
'{{ SkipModelValidation }}',
'{{ SourceAlgorithmSpecification }}',
'{{ Task }}',
'{{ ValidationSpecification }}',
'{{ ApprovalDescription }}',
'{{ LastModifiedTime }}',
'{{ ModelPackageVersion }}',
'{{ AdditionalInferenceSpecificationsToAdd }}',
'{{ ModelPackageStatusDetails }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.sagemaker.model_packages
WHERE data__Identifier = '<ModelPackageArn>'
AND region = 'us-east-1';

Permissions

To operate on the model_packages resource, the following permissions are required:

Create

ecr:BatchGetImage,
ecr:DescribeImages,
ecr:StartImageScan,
ecr:DescribeImageScanFindings,
sagemaker:AddTags,
sagemaker:CreateModel,
sagemaker:CreateModelPackage,
sagemaker:CreateTrainingJob,
sagemaker:CreateTransformJob,
sagemaker:DescribeTransformJob,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
iam:PassRole,
s3:GetObject

Read

sagemaker:DescribeModelPackage,
sagemaker:ListTags

Update

sagemaker:UpdateModelPackage,
sagemaker:DescribeModelPackage,
sagemaker:ListTags,
sagemaker:AddTags,
sagemaker:DeleteTags

Delete

sagemaker:DeleteModelPackage,
sagemaker:DescribeModelPackage

List

sagemaker:ListModelPackages