QuestionQ78

VerifiedResilient Cloud Solutions

A company uses AWS CloudFormation to manage an application running on Amazon EC2 instances. The instances belong to an Amazon EC2 Auto Scaling group. The company wants its infrastructure to be immutable.

A DevOps engineer must implement a solution that replaces two EC2 instances at a time whenever operating-system configuration updates are required or new Amazon Machine Images (AMIs) are needed. At least four EC2 instances must remain running while an update is in progress.

Which solution meets these requirements?

Explanation

CloudFormation's UpdatePolicy with AutoScalingRollingUpdate performs a rolling replacement of an Auto Scaling group's instances. MaxBatchSize: 2 limits concurrent replacements to two instances, while MinInstancesInService: 4 requires at least four instances to remain in service. Changing the launch template ImageId or UserData and updating the stack applies the new immutable instance configuration through that rolling update.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!