ECS Deployment Circuit Breaker "Rolled Back": Find the Failed Task
An ECS “circuit breaker rolled back” message means your new tasks kept failing, so ECS gave up and restored the last working version.
The short version: the rollback is the symptom, not the cause. Open the service’s Events tab, find the failed deployment’s task definition revision, then open its stopped tasks and read the stoppedReason and container exit code, and the last lines of that task’s CloudWatch log. The usual culprits are a container that exits on start, a missing secret or environment variable, an image tag that doesn’t exist, or a failing load balancer health check. By default ECS gives up after failures equal to half the desired task count (at least 3, at most 200); since July 2026 you can change that threshold.
Quick answer: why ECS rolled back
Your rollback is the circuit breaker doing its job. What you want is the reason it gave up.
A service rollback is a symptom, not the root cause
Imagine Jake owns an online phone-repair shop. An ECS service is running three web containers. A developer pushes a new revision on Friday afternoon and the ECS console reports “deployment rolled back.” The old site remains available, but none of the new features appear. Jake blames ECS. Ethan checks the deployment and discovers that the container starts with a renamed database environment variable. The application exits before it can bind its listening port. The circuit breaker has done its job: it prevented a bad revision from replacing a healthy one.
Jake: “Why did my release disappear if the image built successfully?”
Ethan: “A successful image build proves the image exists. It does not prove the container can start with production secrets, networking, and health checks.”
That separation is the theme of this runbook. Work backward from the failed deployment to a specific task, container, reason, log line, and configuration change. Keep the last working task definition untouched until you understand the failure.
The exact circuit breaker behavior and the 2026 threshold update
The circuit breaker applies to ECS service deployments using the rolling-update deployment controller. Its first stage counts tasks that fail to reach RUNNING. Once tasks reach RUNNING, its second stage watches health checks, including container checks and load balancer or service discovery checks. Once the configured failure threshold is met, the deployment fails. With rollback enabled, ECS attempts to restore the most recent previously COMPLETED deployment. Without an eligible completed deployment, automatic rollback may not be possible.
The default threshold is the ceiling of 50% of the latest desired task count, with a minimum of three and maximum of 200. Since July 2026, you can configure COUNT, BOUNDED_PERCENT and UNBOUNDED_PERCENT thresholds, plus a resetOnHealthyTask setting that switches between consecutive and cumulative counting. Older articles that say the 3-to-200 range cannot be customized are out of date.
| Desired tasks | Default calculation | Default failures |
|---|---|---|
| 1 | 50% is below minimum | 3 |
| 3 | 50% is below minimum | 3 |
| 10 | 50% of 10 | 5 |
| 25 | 12.5 rounded up | 13 |
| 400 | 200 | 200 |
| 800 | Capped at 200 | 200 |
These are failure events counted by the deployment mechanism, not a guarantee that the same number of distinct tasks were started. A single desired task can fail repeatedly and trigger a rollback.
What old and new tasks do during deployment
With a typical rolling configuration, ECS starts replacement tasks and keeps a minimum number of healthy existing tasks available, subject to capacity and the service’s minimumHealthyPercent and maximumPercent settings. Therefore a bad new revision can roll back while customers still reach old containers. But this is not a zero-downtime guarantee: misconfigured deployment percentages, insufficient capacity, a shared incompatible database change, or downstream dependency failures can still produce an outage. Check your running task definition ARNs after rollback instead of assuming all tasks are old and healthy.
A deployment rollback restores ECS deployment configuration, not external database schema, secrets, S3 files, or side effects already performed by the new containers. Preserve compatibility for these components across releases.
You can usually find the cause in five checks. Run them in this order, and you will rarely need the rest of this guide.
The first five console checks in order
- Open ECS, then Clusters, select your cluster and the affected service. Confirm account and Region.
- Open Deployments and record the failed deployment’s task definition revision, status, timing, and the rollback target.
- Open Events. Read backward through task start, stop, unhealthy target, and circuit breaker messages. Capture the earliest event specific to the failed revision.
- Open Tasks, filter Stopped, and inspect tasks from the failed revision. Record task ARN, stopped reason, stop code, container name, reason and exit code.
- Open your task’s CloudWatch log stream or application logging destination. Correlate timestamps with ECS events before changing anything.
A later “deployment completed” message may refer to successful rollback, not success of the bad revision. The failed task definition revision is the key evidence.
Your service events tell you the story in order. Capture them before they scroll away.
Service events and the CLI commands to capture evidence
Run these commands using a principal permitted to describe the affected service and task definitions. Replace sample names, Region, and task ARN. Export evidence before it disappears.
export AWS_REGION=us-east-1
export CLUSTER=production
export SERVICE=web-api
aws sts get-caller-identity
aws ecs describe-services --cluster "$CLUSTER" --services "$SERVICE" --region "$AWS_REGION" \
--query 'services[0].{Status:status,Desired:desiredCount,Running:runningCount,Deployments:deployments[*].{Id:id,TaskDef:taskDefinition,Rollout:rolloutState,Why:rolloutStateReason},Events:events[0:15].[createdAt,message]}' --output json
aws ecs list-tasks --cluster "$CLUSTER" --service-name "$SERVICE" \
--desired-status STOPPED --region "$AWS_REGION" --output json
For a known task ARN, run:
aws ecs describe-tasks --cluster "$CLUSTER" --tasks "$TASK_ARN" \
--region "$AWS_REGION" --query 'tasks[*].{Task:taskArn,TaskDef:taskDefinitionArn,StopCode:stopCode,StoppedReason:stoppedReason,StoppedAt:stoppedAt,Containers:containers[*].{Name:name,Exit:exitCode,Reason:reason,Last:lastStatus}}' --output json
Some tasks stop so early that no application log is created. In that case, look first at stopCode, stoppedReason, and service events.
Recognize the real event text
Event wording varies with deployment phase and current ECS feature version. Examples include “ECS deployment circuit breaker: task failed to start” in deployment state-change events, a service reporting targets unhealthy in a target group, or “deployment failed” with a reason. Treat the literal event as a lead, not a complete diagnosis. One task failing to start might be an image pull error; another task might start but fail an ALB health probe. The steps, evidence, and repair are different.
| Signal | Likely failure phase | Next evidence |
|---|---|---|
| CannotPullContainerError | Before container starts | Registry tag, ECR connectivity, execution role |
| ResourceInitializationError | Task setup | Secrets, logs, storage, networking |
| Essential container exited | Application startup | Container exit code and log stream |
| Health checks failed | After RUNNING | Container check, ALB target reason |
| Deployment circuit breaker triggered | Threshold reached | Earlier events and failed task ARNs |
Jake: "The deployment rolled back, but the old tasks are fine. Where do I even look?"
Ethan: "At the stopped tasks from the new deployment. Their stoppedReason and exit code tell you why the circuit breaker gave up."
How to read exitCode and stoppedReason correctly
The task stoppedReason gives an ECS-level explanation, while a container exitCode says what the container process returned. Exit code 1 often indicates application configuration or runtime failure. Code 137 can indicate forced termination, including possible out-of-memory behavior; correlate with memory metrics and container logs instead of equating it automatically with OOM. Code 0 means the main process ended successfully, which still fails a continuously running web service if it unexpectedly stops. A missing exitCode can mean the container did not start at all.
Identify every essential container. If a required sidecar exits, the task may stop even when your main application seems healthy. Look at container-level reason for each essential container rather than checking only the first one.
CloudWatch application logs: get the last useful line
For awslogs logging, inspect the task definition’s logConfiguration options for awslogs-group and awslogs-stream-prefix. Then open CloudWatch Logs for the relevant stream, normally including prefix/container/task-id. If your service rolled back and a new task now has the same container name, make sure you are reading the failed task, not the newest healthy one. Match the task ID and failure timestamp.
aws ecs describe-task-definition --task-definition web-api:42 \
--query 'taskDefinition.containerDefinitions[*].{Name:name,Essential:essential,Image:image,Log:logConfiguration}' --output json
aws logs tail /ecs/production-web --since 2h --region us-east-1
The logs might say “Missing required environment variable PAYMENT_DB_URL,” “Connection refused,” or “Cannot load certificate.” That is your actionable root cause. If logs are absent, fix log permissions or network reachability and read the pre-start failure information in stoppedReason as well.
Common cause one: the container exits immediately
A container that starts and exits repeatedly is often using the wrong command, failing startup validation, reading a missing configuration file, or unable to contact a dependency. Inspect command and entryPoint in your actual task revision. Confirm your architecture compatibility, runtime user, mounted volumes, and required configuration. A Docker image that works with an interactive shell might be missing the correct default server command in ECS. Run that exact command, with the same environment variables, locally or as an isolated ECS task. Run your image with its ECS arguments, not on its own.
If your container runs fine locally and still fails here, check your health check before anything else.
Common cause two: wrong container health check
The task definition can define a container healthCheck such as a curl probe against localhost:8080/health. If curl is not installed, localhost listens on a different port, or the route responds with 404, ECS repeatedly marks tasks unhealthy. Minimal container images often include neither bash nor curl. Prefer a probe using a binary actually present or a simple application-provided health executable. Review startPeriod, interval, timeout, retries, and whether initialization legitimately needs additional time.
"healthCheck": {
"command": ["CMD-SHELL", "curl -fsS http://localhost:8080/health || exit 1"],
"interval": 30,
"timeout": 5,
"retries": 3,
"startPeriod": 60
}
This only works if curl exists in that image and the app serves /health on port 8080.
Common cause three: ALB health checks do not match
An Application Load Balancer target group may check a different path, port, protocol, or success-code matcher than the task definition’s container health check. A container can report HEALTHY internally yet show unhealthy in the target group. Inspect EC2 > Target Groups > Targets and record the target health reason. Confirm /ready versus /health, HTTP versus HTTPS, your target port, security groups and the service healthCheckGracePeriodSeconds. If your application needs 90 seconds to initialize, use an appropriate grace period; a longer grace period cannot fix a permanent 404.
aws elbv2 describe-target-health --target-group-arn "$TG_ARN" \
--query 'TargetHealthDescriptions[*].{Target:Target.Id,Port:Target.Port,State:TargetHealth.State,Reason:TargetHealth.Reason,Description:TargetHealth.Description}' --output table
The ALB may reach the task over a network path that localhost-based container checks skip. Verify inbound traffic from your load balancer security group to the correct container listener.
Common cause four: missing secrets and environment variables
When deploying a new revision, verify environment entries, secrets references, and actual variable names. An apparently minor rename from DATABASE_URL to DB_URL can crash a production container if your code still expects the former. For ECS secrets injection, also check your task execution role permissions to read the correct Secrets Manager or SSM Parameter Store path and decrypt a customer-managed KMS key as needed. Keep secret values out of task-definition JSON and terminal history while you test; inspect key names, ARNs, IAM role configuration, and CloudTrail errors instead.
Distinguish the task role, which application code uses after startup, from the task execution role, which ECS uses to retrieve images, set up logs, and inject referenced secrets. `ResourceInitializationError` often points to the latter; application SDK AccessDenied typically points to the former.
Common cause five: image tag missing or registry unreachable
An image may have built in CI but not been pushed, been pushed to another account or Region, or been referenced with the wrong case-sensitive tag. A newly rolled back task can report CannotPullContainerError before any application log exists. Confirm task definition image URI, registry credentials, architecture, execution-role policy, subnet route, and ECR VPC endpoints or NAT. Consider immutable image digests rather than mutable “latest” tags so that a release and rollback have reproducible contents.
Capacity, networking, and deployment parameters can also fail
Capacity problems are separate from application bugs. ECS might be unable to place replacement tasks because Fargate capacity is unavailable, EC2 instances lack memory, a subnet has exhausted free IP addresses, or network interfaces cannot be created. Read service events and stop reasons before changing health checks. Confirm desiredCount, capacityProviderStrategy, min/max percent and subnet placement. A service with maximumPercent 100 can lack room to launch replacements before stopping tasks; high availability and rollback behavior depend on these deployment constraints.
How to test a new task definition without updating the service
Register the proposed task definition as a new revision, then use `aws ecs run-task` with one task in a safe subnet/security-group combination. Use the same image, environment, execution role, task role and, as far as practical, network and secret dependencies. This smoke test proves startup and container health, but it does not test ALB target-group registration, because a standalone task is not automatically enrolled in the service’s target group. To test end-to-end routing, deploy to a nonproduction service wired to a test target group.
aws ecs run-task --cluster production --launch-type FARGATE \
--task-definition web-api:43 \
--network-configuration 'awsvpcConfiguration={subnets=[subnet-EXAMPLE],securityGroups=[sg-EXAMPLE],assignPublicIp=DISABLED}' \
--count 1 --region us-east-1
# Then describe the returned task ARN and inspect the application logs.
# Stop your isolated task after validating it.
Run this only with real VPC IDs and permissions. A private task needs relevant egress through NAT or endpoints to start.
Here is a rollback, worked from the first event to the fix, so you can follow the same trail on your own service.
Worked example: one wrong environment variable causes rollback
Jake has a service named web-api with desiredCount=3. The last completed deployment uses task definition web-api:41. A new revision web-api:42 deploys successfully through the image pipeline, but ECS fails the new release and rolls back to revision 41. At first glance this looks like an ECS problem. Ethan follows the evidence in order:
- On the ECS Service Deployments page, he sees revision 42 marked FAILED and a rollback that returned revision 41 to service.
- Service Events show repeated replacement tasks stopped before they became healthy, followed by the circuit breaker failure message.
- In Stopped Tasks, he selects a task from revision 42 and records its task ARN; the essential container has exitCode 1.
- He opens the matching CloudWatch Logs stream. The application reports: `Missing required environment variable DATABASE_URL`.
- Comparing revision 41 to revision 42, he discovers CI renamed the environment-variable key to `DB_CONNECTION` but application code was unchanged.
- He creates revision 43 restoring `DATABASE_URL` through the approved secrets-reference mechanism, runs one isolated smoke-test task, and verifies container readiness.
- He deploys revision 43 to the service, watches target health and stopped tasks, and confirms COMPLETED with the expected revision.
The circuit breaker did not cause the environment-variable bug. It limited exposure to the faulty deployment. No thresholds, health-check shortcuts, or disabled rollback were needed. The sample names, versions, and log line are illustrative rather than drawn from a customer environment.
Jake: “Should we turn off rollback to see errors for longer?”
Ethan: “First capture stopped-task data and logs. Disabling rollback in production can strand the service in a failed deployment without restoring availability.”
Rollback enabled versus failed deployment without rollback
A circuit breaker configured with enable=true and rollback=true fails an unhealthy deployment and tries to restore the most recent completed one. With rollback=false, the new deployment still fails and stops scheduling new tasks, but ECS does not automatically recover the older revision for you. This may simplify controlled debugging in an isolated test service while significantly increasing operational risk in production. When rollback is unavailable because no completed deployment exists, investigate the initial service baseline and make a deliberate recovery decision.
aws ecs describe-services --cluster production --services web-api \
--query 'services[0].deploymentConfiguration.deploymentCircuitBreaker' --output json
# Test environments only; review the entire deployment configuration first:
aws ecs update-service --cluster test-cluster --service web-api \
--deployment-configuration 'deploymentCircuitBreaker={enable=true,rollback=false}'
Changing a deployment configuration does not necessarily create a new revision or resolve an already failed deployment. Restore your policy after debugging.
Why a container works locally but fails in ECS
A local `docker run` does not necessarily use the same runtime user, VPC routing, IAM identity, secrets, environment variables, mounted volumes, CPU architecture, read-only filesystem, or ALB target-group checks as ECS. Conversely, ECS may pull the correct image but start it with an older task definition command or different port. Treat a local pass as one signal. Test the complete deployed contract, particularly the production task definition and outbound dependency access.
Jake: “It passed our laptop Docker check.”
Ethan: “That checks the binary. ECS also checks the operating environment, workload scheduling, and live health path.”
You can hear about your next rollback the moment it happens instead of from your users.
How to alert on rollback using EventBridge
ECS publishes deployment-state events to EventBridge. Match `source` aws.ecs, detail-type `ECS Deployment State Change`, and detail.eventName `SERVICE_DEPLOYMENT_FAILED`. Forward matching events to an SNS topic, incident integration, log group, or monitored workflow. Ensure the EventBridge target has the proper resource policy and inspect failed invocations. An alert should contain account, Region, cluster/service ARN, deploymentId, event reason, and an operational link to ECS or your log dashboard.
{
"source": ["aws.ecs"],
"detail-type": ["ECS Deployment State Change"],
"detail": {
"eventName": ["SERVICE_DEPLOYMENT_FAILED"]
}
}
This is an EventBridge event pattern, not the full event body. Use EventBridge archive or persistent target logging if your postmortem depends on retaining it.
An automated incident snapshot for disappearing stopped tasks
Stopped tasks stay visible in DescribeTasks for at least one hour. Capture failure evidence as soon as an EventBridge failure event arrives. A Lambda subscribed to STOPPED task state-change events can store task metadata, stoppedReason, exitCode, task definition ARN, and matching log stream information in a secure incident log. Leave environment secrets out of the copy. Retain logs long enough for compliance and debugging, and limit who can read them.
An incident snapshot is more valuable than a Slack message saying only “rollback.” It saves you from guessing which task failed once newer healthy tasks are running.
The practical release checklist
- Pin your image digest and compare task definition revisions.
- Confirm mandatory environment keys and secrets ARNs without printing the values.
- Verify task execution role and private-subnet ECR/logs/secrets connectivity.
- Run a standalone smoke test, then a canary or test-service ALB check.
- Check your container health command exists and its endpoint is real.
- Match load balancer health path, target port, matcher and security groups.
- Enable rollback with thresholds appropriate to actual deployment behavior.
- Publish SERVICE_DEPLOYMENT_FAILED events to monitoring.
- Retain stopped-task diagnostics and application logs.
- Confirm final deployment status COMPLETED, desired healthy tasks, and correct revision.
Advanced investigation: compare revisions without exposing secrets
A deployment rollback often requires comparing task definition revisions, but keep sensitive plaintext environment values out of the incident ticket. The ECS DescribeTaskDefinition response contains environment key names and possibly plaintext values, secret references, role ARNs, image digests, commands, mount points, and health checks. Treat this response as potentially sensitive. Compare selected fields in a restricted workstation or approved CI diagnostic job and redact values before sharing.
A safe investigation can begin with image URI, container name, CPU and memory, entrypoint, command, port mappings, health checks, logging configuration and secret name references. Specifically check whether the required variable exists by name without copying its literal secret. If your task definition includes values directly in its environment array, rotate compromised secrets and migrate them to Secrets Manager or Parameter Store. A role or registry problem should be investigated through IAM or pull failures rather than introducing more credentials.
If your service uses sidecars, compare changes to each essential container. A logging sidecar that terminates at startup can make an otherwise healthy application task stop. If one revision modifies containerDependencies, verify that the dependency condition is satisfiable. ECS dependency conditions such as START, COMPLETE, SUCCESS, and HEALTHY can change startup sequencing; a dependent container might not start because the required sidecar did not satisfy its condition.
Health check grace period and startup time: how to tune without hiding failures
Java, .NET and some Python applications may need additional time to initialize JIT caches, database pools or schema validations. Measure cold-start behavior from the exact ECS logs and ALB target health timeline before setting a grace period. The service healthCheckGracePeriodSeconds allows ECS to ignore certain unhealthy health check signals during startup; it is not an exemption from missing image, secret, or task placement errors. Similarly a container health check startPeriod allows a startup allowance, but failed checks after that window still matter.
A useful design is to separate liveness from readiness. Liveness answers whether the process is operating; readiness answers whether it can serve real application requests. For an ALB target group, use a lightweight readiness endpoint that checks the dependencies required to serve customer traffic, but not unrelated third-party integrations whose temporary outage should not trigger a fleet-wide rolling restart. Point health checks at an endpoint that fails when your app cannot serve requests, not one that always returns 200.
The target group also has its own healthy/unhealthy thresholds, interval, timeout and matcher. Short thresholds can cause a slow release to fail before it has enough time to stabilize. Increasing these settings can reduce false positives, but it also delays detection of truly broken code. Record observed warm-up times and use controlled load testing to choose settings. When the target goes unhealthy, capture target-health reason strings before the rollback swaps the target away.
Task roles, execution roles and network paths during deployments
ECS uses different identities and network hops while constructing a task. The task execution role permits operations performed by ECS or its task initialization components, such as retrieving images, sending logs and obtaining referenced secrets. The task role is the identity exposed to application code for AWS API calls after your task starts. A new secret reference in the task definition often requires execution-role permission; a new DynamoDB call inside the app usually requires task-role permission. Mixing the roles makes debugging slower and expands access unnecessarily.
In a private subnet without NAT, check the exact endpoints your task requires. ECR image pulls commonly need ecr.api, ecr.dkr and S3 access for image layers; awslogs requires CloudWatch Logs connectivity; Secrets Manager or Systems Manager Parameter Store references can need service-specific endpoints. Security groups for interface endpoints must allow the task network traffic on HTTPS, and private DNS must resolve the service names appropriately. If image pull fails before startup, adjusting the application's ALB path cannot fix it.
When a task reaches RUNNING and then exits because the database connection times out, diagnose the database route, port, security groups, DNS and TLS. Keep production security groups closed to the internet, even temporarily. Use ECS Exec on a healthy representative task where approved, VPC Flow Logs, Reachability Analyzer when applicable, and bounded connection tests to prove the specific network path. Each hypothesis should result in a narrow configuration change and a measurable new test.
A practical incident timeline and a safer rollback playbook
At minute zero, capture the service and deployment status, including revision ARN and rolloutStateReason. Next capture service events and stopped task ARNs. Save container status codes, container reason, task stop reason and correlated CloudWatch log stream names. If the console no longer shows the failing task, check EventBridge archives, incident logging and retained application logs. Repeated blind force-new-deployment actions may produce new failures while removing useful task details from the UI.
For the next few minutes, protect customer availability. Confirm the prior completed deployment is running healthy tasks behind the load balancer, check HTTP error rate and latency, and suspend unrelated rollouts. If the rollback is in progress, let it finish before you start a second deployment, unless your incident response explicitly needs one. A rollout state of COMPLETED on the restored old revision is different from the new revision succeeding.
Once service is stable, identify a minimal repair. In Jake’s example, the fix is restoring a missing variable reference. Register a fresh task definition with a new revision, run an isolated smoke test, then a preproduction service with the same target group behavior. Only after proving its startup, dependencies, and readiness should you deploy to production. Confirm the resulting ECS service points at the new repaired revision, all desired tasks are healthy, and no rollback alert has fired.
Finally document what escaped CI: the application's environment contract was not validated against the task definition. Add an automated predeploy check for required environment names, a simple boot test, and a staging target-group probe. Record the exact failing and fixed revisions so the incident can be reproduced. A rollback is useful protection, but a release gate that catches the error before production is better.
Operational metrics to retain after the incident
A good dashboard covers more than ECS desired versus running count. Include service desired, pending and running tasks; application request error rate, latency and target group healthy host count; deployment changes; CPU and memory pressure; and counts of stopped-task reasons. Where task-level telemetry is available, group failures by task definition revision. This avoids mistaking an intentional traffic shift or routine scale event for a bad release.
CloudWatch Container Insights can support workload resource investigations, and ordinary application logs should include start-up readiness milestones without exposing secrets. Consider emitting a startup validation failure as a structured log with the name of the missing variable but not its value. For a Java application, preserve the initialization exception and root cause; for a Python or Node service, log the configuration validation exception before the process exits.
Alerting should be actionable. Send EventBridge deployment failures to an incident notification route, but suppress duplicate alerts for the same deployment ID if the target system supports deduplication. Add a link to the ECS service, failing task definition, and the timestamped log search. Include the account and Region because the same service name may exist in development, staging and production.
Closing: trace the failed task, not the rollback headline
A healthy recovery starts with evidence: service event, failed revision, stopped task, container reason, application log, and a controlled fix. Raise thresholds only for verified workload behavior. Keep rollback protection enabled in production unless you have an equally reliable recovery mechanism. On Jake’s web service, the correct fix was one environment-variable name—not a larger Fargate task or disabling health checks.
Jake: “The rollback wasn’t our outage cause. It was our warning.”
Ethan: “Exactly. Find the first broken task, not the last ECS notification.”
Official references for this guide
- How the ECS deployment circuit breaker detects failures: the two stages, the BOUNDED_PERCENT, UNBOUNDED_PERCENT and COUNT thresholds, and
resetOnHealthyTask. - Configurable circuit breaker settings (July 2026): the announcement of custom thresholds and counting.
- ECS service deployment state change events:
ECS Deployment State ChangeandSERVICE_DEPLOYMENT_FAILEDfor EventBridge alerts. - Amazon ECS stopped task errors: what each stopped reason means.
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: DevOps Engineer – Professional (DOP-C02) • Developer – Associate (DVA-C03 from December 1, 2026) • CloudOps Engineer – Associate (SOA-C03).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. What does the Amazon ECS deployment circuit breaker do?
It spots a rolling deployment whose tasks cannot reach a steady state, marks it failed and, if rollback is on, returns the service to the last completed deployment.
2. Where do you see why the new tasks stopped?
In the stopped tasks' stopped reason and container exit codes (console or describe-tasks) and in the service events.
3. New tasks are killed for failing load balancer health checks while they are still starting. What setting helps?
healthCheckGracePeriodSeconds on the service.
4. Which deployment type does the circuit breaker work with?
The rolling update deployment type (the ECS deployment controller), not CodeDeploy blue/green.
5. Tasks fail with "ResourceInitializationError: unable to pull secrets". Which role needs permission?
The task execution role: secretsmanager:GetSecretValue or ssm:GetParameters, plus kms:Decrypt for a customer managed key.
6. How can CloudWatch alarms roll back an ECS deployment?
Attach the alarms to the service's deployment configuration; if an alarm goes into ALARM during the deployment, ECS rolls back.
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Frequently asked questions
What does ECS deployment circuit breaker rolled back mean?
ECS marked the replacement deployment as failed and attempted to restore the most recent successfully completed deployment because tasks could not start or pass health checks.
How many failed ECS tasks trigger a rollback?
The default threshold is 50 percent of desired count, rounded up and bounded between 3 and 200. Since July 2026, configurable fixed-count or percentage thresholds and counting modes are available.
Does the old task definition keep running during a rollback?
Often the old deployment retains healthy tasks during the rolling update, subject to service deployment percentages and capacity. Verify running tasks because zero downtime is not guaranteed.
Where do I find the exact ECS rollback reason?
Read ECS service deployments and events, identify a stopped task from the failed revision, call DescribeTasks, then inspect the matching container log stream.
How long can I inspect stopped ECS tasks?
DescribeTasks retains stopped tasks for at least one hour; capture their details promptly, and persist task state events for longer postmortems.
What does exit code 1 mean in an ECS container?
It generally means the container process reported an error. Consult application logs for the specific reason, such as a missing configuration value.
Does exit code 137 always mean out of memory?
No. It is consistent with a forced kill, which may involve memory pressure, but it needs confirmation through stop reasons, logs and memory telemetry.
Why does my ECS health check return 404?
The configured path, port, listener or protocol might not match the application. Compare container and load balancer health checks and test the exact endpoint.
How do I turn off automatic rollback for debugging?
In a nonproduction service, keep the circuit breaker enabled and set rollback to false in deployment configuration, understanding that failed deployments will not automatically recover.
Can I disable the deployment circuit breaker completely?
Yes for eligible rolling ECS services through deployment configuration, but consider the reduced failure protection before doing so.
Why does the deployment succeed locally but fail on ECS?
Local tests often omit ECS networking, secrets, IAM, health checks, execution command and production environment variables.
How do I test one task before a service deployment?
Use ECS RunTask with the new task definition and representative network, roles and secrets, then check status and logs; use a test service to validate target-group behavior.
Can ECS automatically roll back the first deployment?
Not if there is no previously completed deployment to restore. Establish a known-good baseline and recover deliberately.
How do I alert on an ECS deployment rollback?
Create an EventBridge rule for source aws.ecs, detail-type ECS Deployment State Change and eventName SERVICE_DEPLOYMENT_FAILED, and route it to SNS or your incident system.
What changed in ECS circuit breaker configuration in 2026?
AWS added configurable COUNT and percentage thresholds plus consecutive or cumulative counting options, while preserving the default bounded 50 percent policy.
What is the safest first action when a rollback happens?
Preserve service events, task ARN, stoppedReason, exitCode and logs before retries or another deployment obscure the failing revision.
Revision note. Written October 24, 2026; updated November 23, 2026 with exam-style practice questions. "Where there's smoke, there's fire," says the proverb; the stopped task holds the reason for the rollback.