You are a DevOps engineer for a company.
You have been requested to create a rolling deployment solution that is cost-effective with minimal downtime.
How should you achieve this? Choose two answers from the options below.
Click on the arrows to vote for the correct answer
A. B. C. D.Answer - B and C.
The AWS::AutoScaling::AutoScalingGroup resource supports an UpdatePolicy attribute.
This is used to define how an Auto Scaling group resource is updated when an update to the CloudFormation stack occurs.
A common approach to updating an Auto Scaling group is to perform a rolling update, which is done by specifying the AutoScalingRollingUpdate policy.
This retains the same Auto Scaling group and replaces old instances with new ones, according to the parameters specified.
Option A is invalid because re-deploying the application using the Cloudformation template alone will not suffice for the requirement given in the question.
Option D is invalid because this is an inefficient process to tear down stacks when there are stack policies available.
For more information on Autoscaling Rolling Updates, please refer to the below link:
https://aws.amazon.com/premiumsupport/knowledge-center/auto-scaling-group-rolling-updates/To achieve a cost-effective rolling deployment solution with minimal downtime, we need to use CloudFormation and Auto Scaling groups.
Answer B and C are the correct solutions to this question.
B. Re-deploy with a CloudFormation template, define update policies on Auto Scaling groups in your CloudFormation template: This approach involves updating your CloudFormation template with the new version of your application and defining update policies on the Auto Scaling group. Auto Scaling groups allow us to add or remove instances of our application in response to changes in demand. When updating the Auto Scaling group with new instances, we can define update policies that specify the maximum number of instances that can be updated at any given time. This approach allows us to gradually roll out the new version of our application with minimal downtime.
C. Use UpdatePolicy attribute with AutoScalingRollingUpdate policy on CloudFormation to deploy new code: In this approach, we use the UpdatePolicy attribute with the AutoScalingRollingUpdate policy in the CloudFormation template. This policy allows us to update the Auto Scaling group with new instances while simultaneously removing the old ones. This approach ensures that the new version of our application is rolled out in a controlled and predictable manner, with minimal downtime.
A. Re-deploy your application using a CloudFormation template: This option is incorrect because it does not take into account the need for a rolling deployment strategy. Simply redeploying the application using a CloudFormation template would result in downtime while the new version is deployed.
D. After each stack is deployed, tear down the old stack: This option is also incorrect because tearing down the old stack after each deployment would result in downtime as the old version is replaced by the new one.
Therefore, the correct answers are B and C.