exam questions

Exam AWS Certified Solutions Architect - Professional All Questions

View all questions & answers for the AWS Certified Solutions Architect - Professional exam

Exam AWS Certified Solutions Architect - Professional topic 1 question 502 discussion

A Solutions Architect has created an AWS CloudFormation template for a three-tier application that contains an Auto Scaling group of Amazon EC2 instances running a custom AMI.
The Solutions Architect wants to ensure that future updates to the custom AMI can be deployed to a running stack by first updating the template to refer to the new
AMI, and then invoking UpdateStack to replace the EC2 instances with instances launched from the new AMI.
How can updates to the AMI be deployed to meet these requirements?

  • A. Create a change set for a new version of the template, view the changes to the running EC2 instances to ensure that the AMI is correctly updated, and then execute the change set.
  • B. Edit the AWS::AutoScaling::LaunchConfiguration resource in the template, changing its DeletionPolicy to Replace.
  • C. Edit the AWS::AutoScaling::AutoScalingGroup resource in the template, inserting an UpdatePolicy attribute.
  • D. Create a new stack from the updated template. Once it is successfully deployed, modify the DNS records to point to the new stack and delete the old stack.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
9Ow30
Highly Voted 3 years, 7 months ago
C Quoting "If you want to update existing instances when you update the LaunchConfiguration resource, you must specify an UpdatePolicy attribute for the Auto Scaling group. " https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig.html
upvoted 28 times
Stec1980
3 years, 6 months ago
Actually, yes this suggests you can "add an UpdatePolicy attribute to your Auto Scaling group to perform rolling updates" https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html
upvoted 2 times
...
DashL
3 years, 6 months ago
When you update the launch template or launch configuration for an Auto Scaling group, this update action does not deploy any change across the running Amazon EC2 instances in the Auto Scaling group. All new instances will get the updated configuration, but existing instances continue to run with the configuration that they were originally launched with. This works the same way as any other Auto Scaling group. You can add an UpdatePolicy attribute to your stack to perform rolling updates (or replace the group) when a change has been made to the group.
upvoted 2 times
...
Stec1980
3 years, 6 months ago
That's for the AWS::AutoScaling::LaunchConfiguration resource though, not the AWS::AutoScaling::AutoScalingGroup resource, which is what answer C suggests...
upvoted 3 times
...
...
dpvnme
Highly Voted 3 years, 7 months ago
A. Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html
upvoted 16 times
viet1991
3 years, 6 months ago
Aws is C. Without inserting an UpdatePolicy attribute to AWS::AutoScaling::LaunchConfiguration, execute the change set will only create new LaunchConfiguration and existing instances are not affected.
upvoted 2 times
TiredDad
3 years, 6 months ago
Option A says - Create a change set for a new version of the template, as part of that you would include UpdatePolicy attribute to the resource "AWS::AutoScaling::AutoScalingGroup" (and not to LaunchConfiguration)
upvoted 3 times
...
...
simonyu
3 years, 7 months ago
This link says change set will change the stack, not the template.
upvoted 4 times
TiredDad
3 years, 6 months ago
"When you use CloudFormation, you manage related resources as a single unit called a stack. You create, update, and delete a collection of resources by creating, updating, and deleting stacks. All the resources in a stack are defined by the stack's CloudFormation template" - to change a stack, you change its template
upvoted 1 times
...
...
...
aandc
Most Recent 2 years, 10 months ago
Selected Answer: C
vote for C "To update existing instances when you update the AWS::AutoScaling::LaunchConfiguration resource, you can specify an UpdatePolicy attribute for the group. "
upvoted 2 times
...
roka_ua
3 years ago
Selected Answer: C
Vote C
upvoted 1 times
...
shotty1
3 years, 3 months ago
Selected Answer: C
I think the "best" answer is C
upvoted 1 times
...
tkanmani76
3 years, 4 months ago
Answer A - Refer to Section "Update the AMI on an Amazon EC2 instance" in https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/updating.stacks.walkthrough.html.
upvoted 1 times
tkanmani76
3 years, 3 months ago
C is right - Refer Remarks section https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html
upvoted 1 times
...
...
AzureDP900
3 years, 4 months ago
When you update the launch configuration for an Auto Scaling group, CloudFormation deletes that resource and creates a new launch configuration with the updated properties and a new name. Existing instances are not affected. To update existing instances when you update the AWS::AutoScaling::LaunchConfiguration resource , Answer C is right
upvoted 1 times
...
DerekKey
3 years, 6 months ago
"UpdateStack to replace the EC2 instances with instances launched from the new AMI" A wrong - will only apply to EC2 instances managed separately B wrong C correct - have to use UpdatePolicy attribute on Auto Scaling group D wrong
upvoted 1 times
TiredDad
3 years, 5 months ago
Your statement "A wrong - will only apply to EC2 instances managed separately" is incorrect. Option A says "Create a change set for a new version of the template" and the template in this case corresponds to the stack which includes AutoScalingGroup
upvoted 1 times
...
...
WhyIronMan
3 years, 6 months ago
I'll go with C
upvoted 2 times
...
Pb55
3 years, 6 months ago
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html C.
upvoted 1 times
...
ss160700
3 years, 6 months ago
B: - reason as below { "Resources": { "LaunchConfig": { "Type": "AWS::AutoScaling::LaunchConfiguration", "Properties": { "KeyName": { "Ref": "KeyName" }, "ImageId": { "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" }, { "Fn::FindInMap": [ "AWSInstanceType2Arch",
upvoted 1 times
...
ss160700
3 years, 6 months ago
A - it us the changes
upvoted 1 times
...
Waiweng
3 years, 6 months ago
it's C
upvoted 1 times
...
cnethers
3 years, 6 months ago
The best answer is A because: - creating a changeset is the accepted method for making changes to a stack. - it includes all the changes in the template that are required - changes that would be required would not just be updating the ASG UpdatePolicy attribute, it would also require updating the AMI ID, it would be worth parameterizing the AMI ID so that it's just a parameter change in the future. Launch Config would need replacing because a new AMI is being used and launch configs can't be updated, they are replaced and then deleted once you have successfully deployed an "in-service" instance so that roll-back can occur. There is more to this question than first considered. Don't rush to the first answer the makes sense, sometimes there is a better answer. B and C and not wrong but they are not the best answer. D could be done but really why would you do that?
upvoted 1 times
...
gpark
3 years, 6 months ago
C. === A. is not enough. Please, reference below https://aws.amazon.com/premiumsupport/knowledge-center/auto-scaling-group-rolling-updates/
upvoted 1 times
TiredDad
3 years, 5 months ago
UpdatePolicy has to be included in the template, so although not mentioned explicitly, option A covers that
upvoted 1 times
...
...
kiev
3 years, 6 months ago
Change set is to help you view changes before they are made in CF. To introduce new AMI then you have to look at the launch auto scaling group and update it and so I would go with C.
upvoted 1 times
TiredDad
3 years, 5 months ago
Option A includes executing the change set as well. You don't need to separately look at "the launch auto scaling group and update it"
upvoted 1 times
...
...
Kian1
3 years, 6 months ago
going with C
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago