images
Creates, updates, deletes or gets an image resource or lists images in a region
Overview
| Name | images |
| Type | Resource |
| Description | Resource Type definition for AWS::SageMaker::Image |
| Id | awscc.sagemaker.images |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
image_name | string | The name of the image this version belongs to. |
image_arn | string | The Amazon Resource Name (ARN) of the parent image. |
image_role_arn | string | The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on behalf of the customer. |
image_display_name | string | The display name of the image. |
image_description | string | A description of the image. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
image_arn | string | The Amazon Resource Name (ARN) of the parent image. |
region | string | AWS region. |
For more information, see AWS::SageMaker::Image.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | images | INSERT | ImageName, ImageRoleArn, region |
delete_resource | images | DELETE | Identifier, region |
update_resource | images | UPDATE | Identifier, PatchDocument, region |
list_resources | images_list_only | SELECT | region |
get_resource | images | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all images in a region.
SELECT
region,
image_arn
FROM awscc.sagemaker.images_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new image resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ create */
INSERT INTO awscc.sagemaker.images (
ImageName,
ImageRoleArn,
ImageDisplayName,
ImageDescription,
Tags,
region
)
SELECT
'{{ image_name }}',
'{{ image_role_arn }}',
'{{ image_display_name }}',
'{{ image_description }}',
'{{ 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: image
props:
- name: image_name
value: '{{ image_name }}'
- name: image_role_arn
value: '{{ image_role_arn }}'
- name: image_display_name
value: '{{ image_display_name }}'
- name: image_description
value: '{{ image_description }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
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:
| 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 images resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
sagemaker:CreateImage,
sagemaker:DescribeImage,
iam:PassRole,
sagemaker:AddTags,
sagemaker:ListTags
sagemaker:DescribeImage,
sagemaker:ListTags
sagemaker:UpdateImage,
sagemaker:DescribeImage,
sagemaker:ListTags,
sagemaker:AddTags,
sagemaker:DeleteTags,
iam:PassRole
sagemaker:DeleteImage,
sagemaker:DescribeImage
sagemaker:ListImages