Question

Difficulty: MediumDeployment Strategy Design

An enterprise is deploying a new version of a stateless Java-based web application to Amazon EC2 instances within an Auto Scaling group. The infrastructure is managed using AWS CloudFormation. The deployment strategy requires zero downtime, guarantees that new EC2 instances are fully booted and verified as healthy before older instances are terminated, and automatically rolls back to the previous stable version if the deployment fails.

Which two configurations should a solutions architect implement to meet these requirements? (Select two.)

  1. Configure an UpdatePolicy with the AutoScalingRollingUpdate attribute on the AWS::AutoScaling::AutoScalingGroup resource, setting both MinInstancesInService to a value greater than zero and WaitOnResourceSignals to true.Answer
  2. Include the cfn-signal helper script in the EC2 instance UserData, configured to signal success to the CloudFormation stack only after the application process is fully running and has passed local health checks.Answer
  3. C
    Configure an UpdatePolicy with the AutoScalingReplacingUpdate attribute on the AWS::AutoScaling::AutoScalingGroup resource, and rely on the Application Load Balancer target group health check to automatically signal completion.
  4. D
    Define a CloudFormation parameter to trigger a rolling update of the Launch Template, setting the PauseTime to zero to allow the Application Load Balancer to immediately shift traffic using connection draining.
  5. E
    Deploy a second duplicate Auto Scaling group for the new launch template version, configure Route 53 weighted records to split traffic, and configure a CloudWatch alarm to trigger stack deletion on failure.

Answer

To meet the requirements, the solutions architect should configure the CloudFormation template to use the AutoScalingRollingUpdate update policy on the Auto Scaling group with WaitOnResourceSignals set to true, and use the cfn-signal helper script in the EC2 instance UserData to signal success after the application has fully initialized and passed health checks.
To achieve zero downtime and automatic rollbacks during a CloudFormation-managed Auto Scaling group update, the solutions architect must configure the AutoScalingRollingUpdate policy with WaitOnResourceSignals set to true. This forces CloudFormation to wait for a predefined number of success signals before moving to the next batch of instances. To generate these signals, the cfn-signal helper script must be executed within the EC2 instance's UserData after the application successfully starts and passes local verification. If the instances fail to signal within the PauseTime period, CloudFormation aborts the deployment and rolls back to the previous launch template version.

Step-by-Step Solution

1
Configure the CloudFormation template to use a rolling update strategy.
Add an UpdatePolicy with the AutoScalingRollingUpdate attribute to the AWS::AutoScaling::AutoScalingGroup resource, ensuring that MinInstancesInService is greater than zero to maintain capacity.
This guarantees zero downtime by updating the instances in batches rather than all at once.
2
Enable CloudFormation to wait for application-level readiness signals.
Set WaitOnResourceSignals to true in the AutoScalingRollingUpdate policy configuration.
This prevents CloudFormation from proceeding to the next batch of updates until it receives confirmation that the current batch is healthy.
3
Implement the signaling mechanism on the EC2 instances.
Add the cfn-signal helper script to the launch template's UserData, configuring it to execute and send a success signal only after the application has fully bootstrapped and passed local health checks.
This provides the actual readiness signal to CloudFormation, enabling automated rollback if the timeout is reached without receiving the signals.

Key Concept

AWS CloudFormation AutoScalingRollingUpdate deployment strategy with resource signaling
Rate this question