Skip to content
GitHubXDiscord

Image

The Image resource allows you to create and manage AWS SageMaker Images for building machine learning models and workflows.

Create a basic SageMaker Image with required properties and a common optional property:

import AWS from "alchemy/aws/control";
const sageMakerImage = await AWS.SageMaker.Image("mySageMakerImage", {
ImageName: "my-image",
ImageRoleArn: "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
ImageDisplayName: "My SageMaker Image"
});

Configure a SageMaker Image with an optional description and tags:

const advancedSageMakerImage = await AWS.SageMaker.Image("advancedSageMakerImage", {
ImageName: "advanced-image",
ImageRoleArn: "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
ImageDescription: "An advanced SageMaker image for training models.",
Tags: [
{ Key: "Project", Value: "AIModel" },
{ Key: "Environment", Value: "Development" }
]
});

Adopt an existing SageMaker Image instead of failing if it already exists:

const adoptSageMakerImage = await AWS.SageMaker.Image("existingSageMakerImage", {
ImageName: "existing-image",
ImageRoleArn: "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
adopt: true // Adopt existing resource if it exists
});

Update an existing SageMaker Image with a new display name and description:

const updatedSageMakerImage = await AWS.SageMaker.Image("updateSageMakerImage", {
ImageName: "my-image",
ImageRoleArn: "arn:aws:iam::123456789012:role/SageMakerExecutionRole",
ImageDisplayName: "Updated SageMaker Image",
ImageDescription: "An updated description for the SageMaker image."
});