exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 80 discussion

An application running on a set of Amazon EC2 instances in an Auto Scaling group requires a configuration file to operate. The instances are created and maintained with AWS CloudFormation. A DevOps engineer wants the instances to have the latest configuration file when launched, and wants changes to the configuration file to be reflected on all the instances with a minimal delay when the CloudFormation template is updated. Company policy requires that application configuration files be maintained along with AWS infrastructure configuration files in source control.

Which solution will accomplish this?

  • A. In the CloudFormation template, add an AWS Config rule. Place the configuration file content in the rule’s InputParameters property, and set the Scope property to the EC2 Auto Scaling group. Add an AWS Systems Manager Resource Data Sync resource to the template to poll for updates to the configuration.
  • B. In the CloudFormation template, add an EC2 launch template resource. Place the configuration file content in the launch template. Configure the cfn-init script to run when the instance is launched, and configure the cfn-hup script to poll for updates to the configuration.
  • C. In the CloudFormation template, add an EC2 launch template resource. Place the configuration file content in the launch template. Add an AWS Systems Manager Resource Data Sync resource to the template to poll for updates to the configuration.
  • D. In the CloudFormation template, add CloudFormation init metadata. Place the configuration file content in the metadata. Configure the cfn-init script to run when the instance is launched, and configure the cfn-hup script to poll for updates to the configuration.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
4555894
Highly Voted 1 year, 1 month ago
Selected Answer: D
Use the AWS::CloudFormation::Init type to include metadata on an Amazon EC2 instance for the cfn-init helper script. If your template calls the cfn-init script, the script looks for resource metadata rooted in the AWS::CloudFormation::Init metadata key. Reference: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html
upvoted 7 times
...
steli0
Most Recent 5 months ago
Selected Answer: D
It's D
upvoted 1 times
...
jamesf
9 months ago
Selected Answer: D
Require CloudFormation init for cfn-init and cfn-hup https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-hup.html https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-init.html
upvoted 2 times
...
[Removed]
1 year, 1 month ago
Selected Answer: D
In this scenario, CloudFormation init metadata is the most suitable approach for ensuring that instances launched by the Auto Scaling group have the latest configuration file.
upvoted 2 times
...
thanhnv142
1 year, 2 months ago
D is correct: <The instances are created and maintained with AWS CloudFormation> means we will only use ACF to satisfy the requirements of this question. <changes to the configuration file to be reflected on all the instances with a minimal delay when the CloudFormation template is updated> means we nead cfn-init, which is a daemon that check for updates and update the changes A and C: no mention of cfn-init B: no mention of CloudFormation init. we need CloudFormation init because cfn-init is specified in CloudFormation init key.
upvoted 3 times
...
khchan123
1 year, 3 months ago
Selected Answer: D
D. cfn-hup poll for cloudformation metadata. B is wrong because putting the config content in launch template instead of metadata, where cfn-hub is not able to poll.
upvoted 4 times
...
a54b16f
1 year, 3 months ago
Selected Answer: D
cfn-init is defined inside AWS::CloudFormation::Init
upvoted 2 times
...
yuliaqwerty
1 year, 3 months ago
I vote for B
upvoted 1 times
...
Jaguaroooo
1 year, 3 months ago
But what happened to the aspect of using source control?
upvoted 4 times
...
a16a848
1 year, 4 months ago
Selected Answer: B
Google Bart says it is B. By using an EC2 launch template resource, the configuration file will be installed and configured on all instances when they are launched. The cfn-init script will also poll for updates to the configuration, so that all instances will have the latest configuration file as soon as it is updated. In addition, the solution will comply with company policy by storing the configuration file in source control along with the AWS infrastructure configuration files. This will ensure that changes to the configuration file are tracked and managed in a consistent way. Option C: Using an AWS Systems Manager Resource Data Sync resource alone is not enough to ensure that all instances have the latest configuration file. The cfn-init script is needed to install and configure the configuration file on the instance, and the cfn-hup script is needed to poll for updates to the configuration.
upvoted 2 times
...
svjl
1 year, 4 months ago
Selected B: You can have cfn on Launch Config and Launch Template https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-hup.html https://stackoverflow.com/questions/54691327/cfn-init-for-cloudformation-launchtemplate
upvoted 3 times
...
HugoFM
1 year, 4 months ago
Selected Answer: B
I choos B because the config file must be mantained along teh insfrastructure configuration files in source control
upvoted 1 times
...
zenith_cloud
1 year, 6 months ago
Selected Answer: B
B and D are similar. I will go for B, because D doesn't involve EC2 launch templates
upvoted 1 times
...
RVivek
1 year, 7 months ago
Selected Answer: D
cfn-init and cfn-hup are used to update metadata. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-hup.html
upvoted 2 times
...
Aja1
1 year, 9 months ago
option C provides a reliable and scalable solution to manage the configuration file for the application running on the EC2 instances, while also adhering to company policies regarding source control for configuration files.
upvoted 1 times
Aja1
1 year, 8 months ago
D cfn-hup is a daemon that detects changes in resource metadata and runs user-specified actions when a change is detected. This allows you to automatically update the configuration of your Amazon EC2 instances when you make changes to your AWS CloudFormation stacks.
upvoted 4 times
...
...
rhinozD
1 year, 10 months ago
Selected Answer: D
D Metadata: "AWS::CloudFormation::Init":
upvoted 4 times
...
2pk
1 year, 11 months ago
Selected Answer: B
By using an EC2 launch template, you can include the configuration file content directly in the template. The cfn-init script can be configured to run when the instance is launched. as CloudFormation init metadata is more suitable for configuring instances during stack creation rather than for dynamically updating configuration files.
upvoted 3 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