{"id":"5e82ecae-21eb-4400-9875-07ba7cca3f32","task":"Amazon SageMaker: use deployment guardrails (canary or linear traffic shifting) to safely update a real-time endpoint","domain":"ml-ops","steps":["Before updating, create CloudWatch alarms on the metrics you want to guard (e.g. error rate, latency) for the endpoint — deployment guardrails require these alarms to monitor the new (green) fleet during the baking period and trigger rollback if they trip.","Create a new EndpointConfig for the updated model, then call the SageMaker UpdateEndpoint API (or `aws sagemaker update-endpoint` CLI) against the existing endpoint, passing EndpointConfigName plus a DeploymentConfig.","For canary shifting, set DeploymentConfig.BlueGreenUpdatePolicy.TrafficRoutingConfiguration = {\"Type\": \"CANARY\", \"CanarySize\": {\"Type\": \"CAPACITY_PERCENT\", \"Value\": <=50}, \"WaitIntervalInSeconds\": <baking period>} — SageMaker routes that canary percentage of traffic to the new (green) fleet first, and only shifts the rest once the baking period passes with no alarm trips.","For linear shifting instead, set TrafficRoutingConfiguration = {\"Type\": \"LINEAR\", \"LinearStepSize\": {\"Type\": \"CAPACITY_PERCENT\", \"Value\": between 10 and 50}, \"WaitIntervalInSeconds\": ...} to shift traffic in several equal-sized steps (n linearly spaced steps) rather than the two-step canary pattern.","Also set TerminationWaitInSeconds (how long to wait after the green fleet is fully active before terminating the old/blue fleet) and MaximumExecutionTimeoutInSeconds (overall deployment time budget), and list your CloudWatch alarms under AutoRollbackConfiguration.Alarms.","Track progress via the DescribeEndpoint API or CloudWatch Events (Endpoint deployment state change) — if any listed alarm trips during a baking period, SageMaker automatically rolls all traffic back to the blue fleet and stops the update."],"gotchas":["Canary size must be <=50% of the green fleet's capacity, and linear step sizes must be between 10-50% of the green fleet's capacity — values outside those ranges aren't valid configurations.","Deployment guardrails only apply to real-time inference and asynchronous inference endpoints; other endpoint types aren't supported.","If your endpoint uses certain other features (see AWS's guardrails 'Exclusions' page), you can't use deployment guardrails or the CloudWatch Events tracking on that endpoint at all — check compatibility before relying on this pattern."],"contributor":"waymark-seed","created":"2026-07-09T00:09:27Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/5e82ecae-21eb-4400-9875-07ba7cca3f32"}