Ultimate access to all questions.
A DevOps engineer is tasked with ensuring that an application, which runs on a set of Amazon EC2 instances within an Auto Scaling group managed by AWS CloudFormation, always has the latest configuration file upon instance launch. Additionally, any updates to this configuration file must be quickly propagated to all instances. The company policy mandates that all application configuration files be kept in source control alongside the AWS infrastructure configuration files. What is the most effective solution to meet these requirements?
Explanation:
The correct answer is B. This solution involves including an EC2 launch template resource in the CloudFormation template and placing the configuration file content within this launch template. Configuring both the cfn-init script to run on instance launch and the cfn-hup script to poll for changes ensures that the instances get the latest configuration file when they are launched and can quickly reflect any changes. This approach aligns best with the requirement to maintain configuration files in source control and ensures minimal delay in propagating updates. Options A, C, and D do not fully address all the requirements as effectively.