Cloud concept · Updated

Rollback - Rollback is the reversal of a change to return a system to a previously known-good operational state.

In short

Rollback limits the impact of defective deployments, unsafe configuration changes, and unsuccessful infrastructure updates by restoring an earlier working version or configuration. Effective rollback requires retained artifacts, compatible data and dependencies, clear failure signals, and a tested recovery procedure.

Cloud Concepts Hub →

6 key aspects of Rollback

Reliable rollback combines a retained recovery target, meaningful health checks, platform-appropriate reversal steps, and explicit handling of data and dependencies.

01
Explicit known-good recovery target

Retain immutable application artifacts, configuration revisions, and deployment metadata. Record compatible dependencies so that recovery does not combine an old application with an incompatible current environment.

02
Health-driven recovery decisions

Define rollback conditions using deployment status and application-level signals, not just instance or container availability. Include observation windows and verify service health after the reversal.

03
Deployment-aware reversal

Match the procedure to the deployment model: redeploy an earlier artifact, reverse a rolling update, or redirect traffic to a retained environment or version. Account for replacement time, connection draining, and mixed-version operation.

04
Data and dependency compatibility

Keep schemas, message formats, and shared dependencies compatible with the rollback target. Treat irreversible writes and external side effects as separate recovery concerns.

05
Controlled configuration recovery

Capture prior settings before automated changes and implement explicit reversal steps. Make recovery safe to retry and reconcile restored settings with the authoritative configuration source.

06
Tested operational readiness

Exercise rollback procedures, preserve diagnostic evidence, and measure recovery time. Plan for failed rollback attempts and define when to escalate to manual intervention or a forward fix.

Cloud services for Rollback

CodeDeploy coordinates application recovery, while CloudFormation handles rollback of supported infrastructure changes. ECS and Lambda provide deployment mechanisms that can return workloads or traffic to earlier versions; EKS exposes Kubernetes revision-based recovery controls. Systems Manager Automation can orchestrate explicit configuration-reversal procedures where deployment tools do not cover the change. CloudWatch alarms and application telemetry provide failure signals and confirm recovery. These mechanisms must be coordinated around compatible artifacts and dependencies: reversing infrastructure, application code, and runtime settings independently can leave an inconsistent system, and none of these services automatically reverses all data changes.

AWS CodeDeployAWS CodeDeploy

CodeDeploy can automatically initiate rollback when configured deployment-failure or alarm conditions occur, redeploying the last known-good application revision. Its deployment and traffic-shifting behavior differs across EC2/on-premises, ECS, and Lambda compute platforms; it does not reverse database changes or external side effects.

AWS CloudFormationAWS CloudFormation

CloudFormation normally attempts to roll back failed stack updates to the prior working stack state. Rollback is not guaranteed to restore application data, and resource changes or missing permissions can cause rollback itself to fail.

AWS LambdaAWS Lambda

Published function versions and aliases allow callers to be redirected to a previous version without overwriting that version's code. CodeDeploy can manage gradual alias traffic shifts and automatic rollback using configured CloudWatch alarms.

AWS Systems ManagerAWS Systems Manager

Systems Manager Automation can run controlled recovery workflows for instance and configuration changes. Runbooks must explicitly capture or locate prior settings and implement reversal and validation steps; failed automation does not inherently undo completed actions.

Rollback exam questions

Real practice exam questions on Rollback, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAP-C03

A financial services company is rehosting a transaction-processing application to Amazon EC2 by using AWS Transform MGN (formerly AWS Application Migration Service). All persistent application state is stored in a database on one of the migrated servers. The application and database servers on premises will be retained for 48 hours after cutover.

The acceptance plan requires the AWS environment to process live transactions for 1 hour. If application validation fails during that hour, the company must resume processing on premises within 15 minutes without losing any acknowledged transactions. Only one environment may accept application writes at a time. The database supports native replication from AWS to an on-premises standby, and rehearsals have demonstrated that synchronization and standby promotion can complete within the recovery window.

Which rollback plan should a solutions architect implement?

Show answerCORRECT ANSWER

Establish and monitor database-native replication from the AWS database to an on-premises standby before accepting production writes in AWS. If validation fails, block new AWS writes, drain in-flight transactions, synchronize through the final committed transaction, fence the AWS writer, promote the standby, and restore on-premises traffic.

The native replication path preserves transactions committed after cutover. Draining writes and verifying final synchronization prevents acknowledged transaction loss, while fencing the AWS writer before promotion prevents concurrent writers. Rehearsals establish that the procedure can meet the 15-minute recovery requirement. MGN alone does not provide this reverse data path.

DOP-C02

A company uses AWS CodeDeploy for in-place deployments to an Amazon EC2 deployment group. Deployment bundles are stored under the same object key in a version-enabled Amazon S3 bucket. Each deployment explicitly identifies an S3 object version.

An engineer manually stops a deployment after business-level validation detects incorrect results. Automatic rollback was disabled for the stop operation. Some instances have successfully installed the defective revision, while others still run the previous revision. CodeDeploy reports the deployment status as Stopped. The deployment group has automatic rollback enabled only for DEPLOYMENT_FAILURE events.

The previous successful deployment's bundle and S3 version ID are retained. Its application remains compatible with all external dependencies, and its lifecycle hooks can safely run again on every instance. The engineer must restore the entire deployment group to that exact release without modifying instances manually.

Which action meets these requirements?

Show answerCORRECT ANSWER

Create a new deployment to the same deployment group, specifying the S3 bucket, object key, and version ID recorded for the previous successful deployment.

An in-place rollback redeploys a previous application revision; it does not reverse installation steps as a transaction. Because the deployment stopped without automatic rollback, a new deployment of the retained, known-good S3 object version restores the group to the exact previous release.

Practice Rollback in a full exam

Questions on Rollback in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Rollback

3 min read

Rollback is a recovery action that reverses a recent change rather than introducing a new fix. Its objective is to restore acceptable service quickly, not necessarily to reconstruct every detail of the previous environment. Engineers should define the rollback target explicitly: an application release, container image digest, function version, infrastructure template, configuration revision, or combination of these. A previous version is useful only if it remains compatible with the current data, dependencies, and security requirements.

Deployment methodology determines how rollback works. For an in-place deployment on virtual machines, recovery might redeploy the previous application artifact and configuration, requiring restarts and temporarily reduced capacity. A blue/green deployment can return traffic to the previous environment if that environment remains available and healthy. A canary deployment limits initial exposure and can route traffic away from the new version when validation fails. Rolling deployments replace instances or tasks incrementally; reversing them also takes time and can leave old and new versions running together during recovery.

Container and serverless platforms require platform-specific actions. An Amazon ECS service can use deployment failure detection with rollback enabled to return to its last completed deployment. In Amazon EKS, a Kubernetes Deployment can revert its Pod template to a retained revision, but a stalled rollout does not automatically undo itself by default. For AWS Lambda, an alias can be redirected to a previously published function version. These actions do not automatically reverse changes to external databases, queues, secrets, or other dependencies.

Configuration changes deserve the same controls as code releases. Suppose an event-driven automation changes a connection limit and application errors increase. A controlled recovery workflow can restore the recorded prior value, verify that the setting took effect, and confirm that error rates and latency recovered. Scope the change to affected resources, use least-privilege permissions, and make recovery steps safe to retry. Coordinate automation with infrastructure-as-code ownership so that the next reconciliation does not immediately reapply the defective configuration.

Automatic rollback should use meaningful signals such as deployment failures, failed synthetic transactions, elevated application error rates, or unacceptable latency. A process starting successfully is not proof that the release works. Define alarm evaluation periods and post-deployment observation time, including how missing metrics are handled. Overly sensitive alarms can reverse healthy releases, while weak health checks allow defective releases to proceed. Manual approval may be appropriate when reversal has substantial business or data consequences.

Rollback is not a database backup restore and is not a universal transaction spanning cloud resources. An application deployment may write records that the old version cannot interpret, send messages, or trigger external payments. Those effects usually require separate recovery or compensating actions. Prefer backward-compatible schema changes and expand-and-contract migrations, delaying destructive changes until older application versions are no longer needed. Restoring a database backup can discard valid writes made after the backup and therefore requires a separate data-recovery decision.

When troubleshooting a failed deployment, correlate release identifiers with logs, metrics, audit events, health-check results, permissions, quotas, and dependency changes. A failed new release may reveal an underlying capacity or networking problem that the previous release will also encounter. Preserve evidence before replacing resources where practical, stop further rollout, execute the recovery procedure, and validate both user-facing behavior and background processing. Infrastructure rollback can itself fail because resources were modified or deleted outside the deployment system.

Retaining old environments and artifacts increases cost, while shorter retention reduces recovery options. Rehearse rollback under realistic load and record recovery duration. If reversal is unsafe, impossible, or would reintroduce a security vulnerability, a tested forward fix may be preferable. A successful rollback restores service; it does not remove the need to investigate and correct the original defect.

Learn Rollback in lessons

3 short lessons on Rollback in 2 certification courses.

Open the lessons