Skip to content
GitHubXDiscord

Endpoint

The Endpoint resource lets you manage AWS SageMaker Endpoints for deploying machine learning models. Endpoints provide a way to host your model for real-time inference, allowing applications to make predictions based on input data.

Create a basic SageMaker Endpoint with required properties and some common optional configurations.

import AWS from "alchemy/aws/control";
const sageMakerEndpoint = await AWS.SageMaker.Endpoint("mySageMakerEndpoint", {
EndpointConfigName: "myEndpointConfig",
RetainAllVariantProperties: true
});

Configure a SageMaker Endpoint with a deployment configuration and tags for better management.

const advancedSageMakerEndpoint = await AWS.SageMaker.Endpoint("advancedSageMakerEndpoint", {
EndpointConfigName: "myAdvancedEndpointConfig",
DeploymentConfig: {
AutoRollbackConfiguration: {
Alarms: [
{
AlarmName: "EndpointErrorAlarm",
AlarmType: "ERROR"
}
]
}
},
Tags: [
{
Key: "Environment",
Value: "Production"
},
{
Key: "Project",
Value: "AIModelDeployment"
}
]
});

Create a SageMaker Endpoint while excluding specific variant properties from the deployment.

const variantExclusionEndpoint = await AWS.SageMaker.Endpoint("variantExclusionEndpoint", {
EndpointConfigName: "myVariantExclusionConfig",
ExcludeRetainedVariantProperties: [
{ VariantName: "LowPriorityVariant" }
],
RetainDeploymentConfig: false
});

Adopt an existing SageMaker Endpoint if it already exists, preventing failure due to duplication.

const adoptExistingEndpoint = await AWS.SageMaker.Endpoint("adoptExistingEndpoint", {
EndpointConfigName: "myExistingEndpointConfig",
adopt: true
});