Skip to main content

images

Creates, updates, deletes or gets an image resource or lists images in a region

Overview

Nameimages
TypeResource
DescriptionResource Type definition for AWS::SageMaker::Image
Idawscc.sagemaker.images

Fields

NameDatatypeDescription
image_namestringThe name of the image this version belongs to.
image_arnstringThe Amazon Resource Name (ARN) of the parent image.
image_role_arnstringThe Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on behalf of the customer.
image_display_namestringThe display name of the image.
image_descriptionstringA description of the image.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourceimagesINSERTImageName, ImageRoleArn, region
delete_resourceimagesDELETEIdentifier, region
update_resourceimagesUPDATEIdentifier, PatchDocument, region
list_resourcesimages_list_onlySELECTregion
get_resourceimagesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual image.

SELECT
region,
image_name,
image_arn,
image_role_arn,
image_display_name,
image_description,
tags
FROM awscc.sagemaker.images
WHERE
region = '{{ region }}' AND
Identifier = '{{ image_arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.sagemaker.images (
ImageName,
ImageRoleArn,
region
)
SELECT
'{{ image_name }}',
'{{ image_role_arn }}',
'{{ 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 image resource, using stack-deploy.

/*+ update */
UPDATE awscc.sagemaker.images
SET PatchDocument = string('{{ {
"ImageRoleArn": image_role_arn,
"ImageDisplayName": image_display_name,
"ImageDescription": image_description,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ image_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.sagemaker.images
WHERE
Identifier = '{{ image_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 images resource, the following permissions are required:

sagemaker:CreateImage,
sagemaker:DescribeImage,
iam:PassRole,
sagemaker:AddTags,
sagemaker:ListTags