Cloud concept · Updated

Rolling Deployment - Rolling deployment updates an application in successive batches while keeping part of the existing deployment available to serve traffic.

In short

A rolling deployment gradually updates or replaces running instances, tasks, or pods instead of changing the entire fleet at once. It limits simultaneous disruption and can avoid maintaining a complete second environment, but requires sufficient capacity, reliable health checks, and compatibility between application versions.

Cloud Concepts Hub →

6 key aspects of Rolling Deployment

Rolling deployment balances incremental change, healthy capacity, version compatibility, and explicit recovery controls to reduce disruption during releases.

01
Incremental fleet updates

Update or replace a subset of resources at a time while the rest continue operating. Choose batch sizes according to workload capacity and the acceptable scope of failure.

02
Availability and capacity controls

Minimum healthy capacity and temporary surge capacity determine how much service remains available during replacement. Account for quotas, scheduler placement constraints, and peak traffic rather than relying only on configured percentages.

03
Health-gated progression

Validate application readiness before sending traffic to updated resources. Use error rates, latency, and other application-level signals to decide whether the rollout should continue or stop.

04
Mixed-version compatibility

Old and new application versions commonly serve traffic simultaneously. Maintain compatible APIs, data schemas, and message formats throughout the transition.

05
Controlled draining and startup

Allow existing requests or jobs to finish before stopping old resources, and allow new resources to initialize before accepting work. Incorrect termination and readiness settings can cause failures even when sufficient capacity exists.

06
Explicit recovery planning

Retain previous artifacts or resource configurations and define rollback triggers. Automatic rollback is platform-dependent, and reverting application code does not undo every data change or external side effect.

Cloud services for Rolling Deployment

A delivery pipeline should select the rollout mechanism that matches the resource being changed. CodeDeploy can deploy application revisions in batches to EC2 instances, while EC2 Auto Scaling instance refresh replaces instances to adopt new machine configurations. ECS and Kubernetes on EKS manage rolling replacement of tasks and pods; Elastic Beanstalk provides managed batching for application environments.

Across these platforms, load balancing, readiness checks, capacity settings, and monitoring determine whether incremental updates preserve service. CloudWatch alarms can inform supported deployment failure controls. Lambda instead uses version and alias traffic shifting, illustrating why a gradual release is not always a rolling fleet update. Recovery behavior must be configured and tested for the selected platform.

AWS CodeDeployAWS CodeDeploy

For EC2 and on-premises applications, CodeDeploy supports in-place deployments with deployment configurations that control deployment concurrency and healthy-host requirements. Lifecycle hooks support application validation; its ECS deployment workflow uses blue/green deployment, while its Lambda workflow shifts traffic between versions.

Amazon EC2 Auto ScalingAmazon EC2 Auto Scaling

Instance refresh progressively replaces Auto Scaling group instances, commonly to adopt a new machine image or launch template version. Healthy-capacity limits, instance warmup, checkpoints, and supported rollback settings help control replacement risk.

AWS Elastic BeanstalkAWS Elastic Beanstalk

Elastic Beanstalk supports rolling application deployments that update instances in batches. Its rolling-with-additional-batch policy adds temporary capacity so the application can maintain serving capacity while batches are updated.

AWS LambdaAWS Lambda

Lambda provides a useful platform contrast: deployments can shift alias traffic between published versions rather than replace customer-managed instances. CodeDeploy supports canary, linear, and all-at-once traffic shifting for Lambda; these should not be confused with host-based rolling replacement.

Rolling Deployment exam questions

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

SOA-C03

A company runs an Amazon ECS service on AWS Fargate with a desired count of four tasks. The service uses rolling deployments. Its task definition injects a password from AWS Secrets Manager into an environment variable when each container starts. The secret reference does not specify a version ID or version stage.

After the password is rotated successfully, the four running tasks still use the previous password. The application cannot reload the environment variable while running. All required permissions and network connectivity are configured, and sufficient capacity is available to launch replacement tasks.

A CloudOps engineer must replace all service tasks so that they receive the current password, maintain service availability, and finish with four service tasks. The container image and secret reference must remain unchanged.

Which action meets these requirements with the LEAST operational effort?

Show answerCORRECT ANSWER

Call UpdateService with forceNewDeployment enabled, retaining the current task definition and desired count.

A forced deployment replaces the service tasks even when the task definition has not changed. Each new task retrieves the current secret value during startup. ECS uses the service's rolling deployment configuration to replace tasks while maintaining availability and returns to the desired count of four.

SAP-C03

A company runs an API on 20 Amazon EC2 instances in an Auto Scaling group behind an Application Load Balancer. The group uses launch template version 41, which references an explicit AMI ID. Desired capacity remains at 20 during releases, and sufficient capacity exists to run up to 22 instances. Application versions are compatible with each other and with the database.

The release pipeline creates launch template version 42 with a new AMI. The company requires deployments to replace instances gradually, maintain at least 20 healthy instances, and run no more than 22 instances at any time. Some releases pass instance and load balancer health checks but cause business transaction failures. An existing Amazon CloudWatch alarm reliably detects these failures. The alarm can enter ALARM during deployment or within 15 minutes after the final instance replacement.

If the alarm enters ALARM during either period, the deployment must automatically restore the previous launch template configuration and replace instances that use the faulty release. No operator intervention or custom rollback orchestration is permitted.

Which deployment configuration meets these requirements?

Show answerCORRECT ANSWER

Start an Auto Scaling instance refresh with desired configuration set to launch template version 42. Set minimum healthy percentage to 100 and maximum healthy percentage to 110. Configure the CloudWatch alarm, enable automatic rollback, and specify a 15-minute bake time.

An instance refresh progressively replaces the fleet. With desired capacity 20, these healthy-percentage settings preserve 20 healthy instances while allowing up to 22 instances. Specifying version 42 as the desired configuration gives Auto Scaling the configuration transition needed for automatic rollback. The configured alarm can trigger rollback during replacement and during the final 15-minute bake time, while the refresh remains in progress.

DVA-C02

A developer is configuring a CI/CD pipeline to deploy new task definition revisions to an Amazon ECS service that uses the ECS rolling deployment controller. The service has a desired count of four tasks. During planned deployments, the configuration must preserve at least four healthy tasks and permit no more than five tasks in the RUNNING or PENDING state. The cluster has sufficient capacity, and new tasks pass health checks after startup. Which deployment configuration enforces both limits while allowing the deployment to make progress without changing the desired count?

Show answerCORRECT ANSWER

Set minimumHealthyPercent to 100 and maximumPercent to 125.

With a desired count of four, these settings require at least four healthy tasks and allow at most five RUNNING or PENDING tasks. ECS can launch one replacement task, wait for it to become healthy, and then stop an old task, repeating until the deployment finishes.

Practice Rolling Deployment in a full exam

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

Start a free practice exam

What is Rolling Deployment

3 min read

A rolling deployment introduces a new application version across a fleet in successive batches. Some instances, tasks, or pods continue serving the previous version while others are updated or replaced. After each batch becomes healthy, the deployment proceeds until the fleet runs the new version. The defining characteristic is gradual change to the serving fleet, not a specific cloud service or deployment tool.

For example, consider a web application running on ten virtual machines behind a load balancer. A deployment process removes two machines from traffic, allows active requests to drain, updates their application, validates readiness, and returns them to service before continuing. The remaining eight machines must handle demand during each batch. Alternatively, the process can launch replacement capacity before removing old machines, increasing temporary cost while preserving serving capacity.

Batch size, minimum healthy capacity, maximum total capacity, startup time, and observation periods determine deployment speed and availability. Small batches reduce the number of resources affected simultaneously but lengthen the rollout. Large batches finish sooner but expose more capacity to a defective release. A successful process checks application readiness and operational signals such as error rates and latency, rather than assuming that a running process is ready to serve users.

For virtual machines, rolling deployment can update application files on existing machines or replace machines using a new image or launch template. AWS CodeDeploy supports batched in-place deployments for EC2 applications. Amazon EC2 Auto Scaling instance refresh progressively replaces instances. These mechanisms solve different problems: deploying application artifacts does not necessarily update the machine image, and changing a launch template alone does not update existing instances.

For containers, an Amazon ECS rolling deployment replaces service tasks according to configured minimum healthy and maximum deployment percentages, subject to available capacity and health checks. Kubernetes Deployments, including those running on Amazon EKS, control replacement pods with maxUnavailable and maxSurge. Readiness probes determine whether pods should receive traffic. A Kubernetes rollout that exceeds its progress deadline is reported as failed; the Deployment controller does not automatically roll it back merely because that deadline expires.

Old and new versions normally coexist during a rollout. APIs, message formats, shared caches, and database schemas must support that overlap. An expand-and-contract database migration can add a new field first, deploy code that supports both schemas, and remove the obsolete field only after old versions are gone. Rolling back application code does not automatically reverse database changes, external side effects, or incompatible messages.

Rolling deployment differs from blue/green deployment, which prepares a separate replacement environment and then switches traffic. It also differs from canary deployment, which deliberately exposes a new version to a limited audience or traffic share for evaluation. A rolling deployment's first batch can provide early feedback, but resource batch size does not guarantee an equivalent percentage of requests. Load balancing, connection reuse, and session affinity affect actual exposure.

Serverless deployments require different terminology. AWS Lambda deployments typically publish versions and shift an alias between them using all-at-once, canary, or linear traffic shifting. Linear traffic shifting is gradual, but it is not replacement of customer-managed hosts in rolling batches. In exam scenarios, distinguish the desired outcome from the platform's supported deployment mechanism.

Rolling deployment does not inherently guarantee zero downtime or automatic rollback. Pipelines must define validation, stop conditions, alarms, and recovery actions supported by the deployment platform. Recovery may require another gradual rollout of the previous version, so retain deployable artifacts and allow enough capacity for both deployment and recovery.

Learn Rolling Deployment in lessons

9 short lessons on Rolling Deployment in 3 certification courses.

and 3 more lessons

Open the lessons