You are a DevOps engineer for a company.
With stack policies in place, you have been requested to create a cost-effective rolling deployment solution 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.
According to the parameters specified, this retains the same Auto Scaling group and replaces old instances with new ones.
Option A is invalid because it is not efficient to use Opsworks to use Elastic Beanstalk.
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 create a cost-effective rolling deployment solution with minimal downtime, there are two solutions:
Let's discuss both in detail:
CloudFormation is a service provided by AWS that allows you to model and provision AWS resources using code. You can use CloudFormation to deploy an application in a controlled and predictable manner, making it ideal for managing a rolling deployment with minimal downtime. With CloudFormation, you can define an update policy for your Auto Scaling groups to ensure that new instances are launched before the old ones are terminated.
To create a rolling deployment with CloudFormation, you would first create a CloudFormation template that describes your infrastructure. The template should include your Auto Scaling group, along with any other resources that are required for your application. Once you have created the template, you can use the AWS CLI or the AWS Management Console to create a CloudFormation stack.
When you update the CloudFormation stack with a new version of your application, CloudFormation creates a new set of resources and replaces the old resources. By defining an update policy in your CloudFormation template, you can control how CloudFormation replaces the resources in your Auto Scaling group.
The AutoscalingRollingUpdate attribute is a property of the Auto Scaling group resource that you can use to control how CloudFormation handles updates to your Auto Scaling group. By using this attribute, you can specify the percentage of instances that can be replaced at a time, the minimum number of healthy instances that must be available during the update, and the amount of time that CloudFormation should wait between replacing instances.
To use this attribute, you would first define an Auto Scaling group resource in your CloudFormation template. You would then set the AutoscalingRollingUpdate property to specify how you want CloudFormation to handle updates to your Auto Scaling group. When you update your CloudFormation stack, CloudFormation will use the settings in your AutoscalingRollingUpdate property to replace instances in your Auto Scaling group.
In conclusion, both solutions involve using CloudFormation to create a controlled and predictable rolling deployment of your application. By defining update policies in your CloudFormation template or using the AutoscalingRollingUpdate attribute, you can minimize downtime and ensure a cost-effective deployment.