AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 76

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?

Answer options

Correct answer: D

Explanation

The correct answer is D because it utilizes CloudFormation init metadata, allowing the configuration file to be included directly and enabling both the cfn-init and cfn-hup scripts to ensure that instances receive the latest configuration upon launch and during runtime. Options A and C incorrectly suggest using AWS Config and Resource Data Sync, which do not meet the requirement for immediate updates on instance launch. Option B, while it mentions cfn-init and cfn-hup, does not utilize the CloudFormation init metadata, which is essential for maintaining the configuration in line with the infrastructure.