Automating Model Deployment, Rollback and Retirement
This lesson explains how automated pipelines with gradual traffic shifting and alarms make model deployments safe, and how lifecycle management replaces models before they are retired.
Learning outcomes
After completing this lesson, you will be able to:
- Build an automated deployment pipeline for approved versions.
- Roll back automatically with deployment guardrails.
- Plan for model lifecycle states and retirement.
Automated deployment pipelines
Deploying a customised model by hand is slow and error-prone, so approved versions are deployed by an automated pipeline. The pipeline starts when a model version's status changes to Approved, an event that Amazon EventBridge can detect. It creates a new SageMaker AI model and endpoint configuration, or updates an inference component, and deploys to a staging endpoint. There it runs smoke tests, which check that the endpoint responds in the expected format, and an evaluation on a golden dataset, which checks that quality meets the threshold. Only if both pass does it deploy to production, often with a gradual traffic shift.
The pipeline is built with SageMaker Pipelines, AWS CodePipeline with CodeBuild steps, or AWS Step Functions, and every resource it creates is defined in infrastructure as code, so that staging and production are configured identically and a failed release can be repeated or reversed reliably.
The following diagram shows the stages of an automated deployment pipeline for a customised model.

Deployment guardrails and rollback
SageMaker AI deployment guardrails update an endpoint with blue/green traffic shifting: all at once, canary (a small share first, then the rest) or linear (equal steps). A baking period follows each step, and if any specified CloudWatch alarm, such as model latency, error rate or a custom quality metric, goes into the ALARM state, SageMaker AI rolls traffic back to the old fleet automatically. Rolling deployments update capacity in batches, which avoids provisioning a full second fleet of expensive GPU instances.
For Bedrock-hosted custom models and prompts, rollback means pointing the application back to the previous custom model or Provisioned Throughput through configuration (for example AppConfig) or an alias. Keeping the previous version deployable until the new one is proven is essential. The following table compares the traffic-shifting options.
| Mode | Traffic shift | Trade-off |
|---|---|---|
| All at once (blue/green) | 100% after baking on the new fleet | Fast; every user exposed at once |
| Canary | Small share, then the rest | Limits exposure; slower |
| Linear | Equal steps with baking | Gradual; slowest |
| Rolling | Batches of instances replaced | No double capacity; mixed versions during rollout |
The following diagram shows a canary deployment of a new model version rolling itself back when an alarm fires.

Traffic shifting modes
Lifecycle management and model retirement
Base models have a lifecycle. Amazon Bedrock labels each model Active, Legacy or end of life (EOL), and the state appears in the console and in the modelLifecycle field of the GetFoundationModel and ListFoundationModels responses. An Active model is fully supported. A Legacy model is scheduled for retirement and has an announced EOL date, usually at least six months after it enters the Legacy state. After the EOL date, requests to the model fail, and migration never happens automatically.
The Legacy state already restricts use. New customers cannot start using a Legacy model, and existing customers can lose access after 15 days without invocations. New Provisioned Throughput and new fine-tuning jobs cannot be created on it, although existing custom model deployments and Provisioned Throughput keep working until EOL. For many models, the later part of the Legacy period is a public extended access period in which the provider can charge higher prices. Custom models built on a retiring base model must therefore be rebuilt on a replacement well before the EOL date. The following list summarises the effect of each state.
- Active: available for new and existing customers, Provisioned Throughput and customisation.
- Legacy: usable until the EOL date by existing users, with no new Provisioned Throughput or fine-tuning jobs and possibly higher prices during public extended access.
- EOL: removed from the listed Regions; requests fail.
Lifecycle management therefore keeps an inventory of every model in use (base model, custom models, adapters and the applications that use them), tracks retirement dates, re-runs the evaluation suite on candidate replacements well before the date, retrains customisations if needed, migrates traffic gradually and finally deletes retired endpoints, Provisioned Throughput and artefacts to stop cost.
The following diagram shows the lifecycle states and what Legacy restricts.

15days
Without invocations before existing customers can lose access to a Legacy model
A model enters Legacy
A failed canary
A new fine-tuned model version passes offline evaluation, but on live traffic its responses are 40% longer, raising latency. The team wants such problems contained and reverted without manual action.
The deployment should use canary traffic shifting with a baking period and auto-rollback alarms on p90 latency and output token count. When the alarm fires during the canary, SageMaker AI shifts traffic back to the previous version, and only the canary share of users was affected.
Which deployment style avoids temporarily doubling the GPU capacity of an endpoint?
Show answer
A rolling deployment, which replaces capacity in batches instead of building a complete new fleet.
Exam Tips
Remember for the exam
- Deploy approved versions through IaC pipelines with staging tests.
- Canary or linear shifting with CloudWatch alarms gives automatic rollback.
- Rolling deployments avoid doubling GPU capacity.
- Track base model Legacy and EOL dates and migrate before retirement.