Orchestrating SageMaker AI endpoint auto scaling with AWS CDK
Summary
- Updating Amazon SageMaker AI endpoint configurations via CloudFormation or AWS CDK fails because endpoints require deregistering scalable targets first.
- A reusable AWS CDK construct with custom resources automatically orchestrates deregistering and registering auto scaling during endpoint updates.
- The construct uses three custom resources and an asynchronous completion pattern to wait for endpoints to reach InService status before re-applying scaling targets.
- A ConfigHash property tracks both endpoint configuration and auto scaling parameters to trigger the orchestration sequence upon any change.
Why it matters
Automating SageMaker AI auto-scaling target lifecycle management during CDK deployments prevents CloudFormation stack rollbacks and deployment failures without manual CLI intervention.