AI Cloud Architect

Orchestrating SageMaker AI endpoint auto scaling with AWS CDK

AWSHow-to by Lauren EternoAWS Artificial Intelligence Blog

Updating a SageMaker AI endpoint that has Application Auto Scaling registered makes AWS CloudFormation and AWS CDK deployments fail. This post shows how to build a reusable AWS CDK construct with CloudFormation custom resources that deregisters and re-registers auto scaling automatically, so you can update the endpoint and its scaling in a single deployment.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Deploy a reusable CDK construct that deregisters and re-registers SageMaker AI endpoint auto scaling around endpoint updates, so one deployment updates both.

Who it is for

Teams deploying SageMaker AI real-time endpoints with CloudFormation or AWS CDK that need to change instance type or scaling settings without stack failures.

Key points

  • Without this, updating an endpoint with auto scaling registered fails; manual deregistration can leave scaling unregistered or roll back into UPDATE_ROLLBACK_FAILED.
  • The construct uses three CloudFormation custom resources; the stack also deploys twelve Lambda functions and two Step Functions state machines.
  • Source code is in the aws-samples sample-sagemaker-endpoint-autoscaling GitHub repository.