# Orchestrating SageMaker AI endpoint auto scaling with AWS CDK

DevFeed: [Orchestrating SageMaker AI endpoint auto scaling with AWS CDK](<https://devfeed.tech/articles/orchestrating-sagemaker-ai-endpoint-auto-scaling-with-aws-cdk-97805.md>)

Original publisher: [Read original article](<https://aws.amazon.com/blogs/machine-learning/orchestrating-sagemaker-ai-endpoint-auto-scaling-with-aws-cdk/>)

Author: Lauren Eterno

Published: 2026-10-23T16:30:10Z

Content type: article

Language: en

Sources: [Artificial Intelligence](<https://devfeed.tech/sources/artificial-intelligence.md>)

Topics: [Amazon SageMaker](<https://devfeed.tech/topics/amazon-sagemaker.md>), [AWS CloudFormation](<https://devfeed.tech/topics/aws-cloudformation.md>), [Deployment & Scaling](<https://devfeed.tech/topics/deployment-scaling.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [Cloud Architecture](<https://devfeed.tech/topics/cloud-architecture.md>), [AWS Step Functions](<https://devfeed.tech/topics/aws-step-functions.md>), [AWS IAM](<https://devfeed.tech/topics/aws-iam.md>)

Tags: [advanced-300](<https://devfeed.tech/tags/advanced-300.md>), [amazon-sagemaker-ai](<https://devfeed.tech/tags/amazon-sagemaker-ai.md>), [auto-scaling](<https://devfeed.tech/tags/auto-scaling.md>), [aws-cdk](<https://devfeed.tech/tags/aws-cdk.md>), [technical-how-to](<https://devfeed.tech/tags/technical-how-to.md>)

## AI overview

Updating a SageMaker AI endpoint while Application Auto Scaling is registered can fail because SageMaker requires the scalable target to be deregistered first; manual deregistration can also leave CloudFormation tracking stale or cause a failed rollback. The described reusable AWS CDK construct replaces native scaling resources with three CloudFormation custom resources ordered around the endpoint update: deregister the target, update the endpoint, wait for it to reach InService before registering the target, then wait until the target is queryable before attaching its scaling policy. Asynchronous CDK providers poll readiness with bounded total timeouts. A ConfigHash causes configuration changes to trigger the orchestration, keeping endpoint and scaling updates in one deployment. The text notes the resulting stack also includes provider-generated Lambda functions and Step Functions state machines.

## Source excerpt

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.