QuestionQ71

VerifiedConfiguration Management and IaC

An application running on a group of Amazon EC2 instances in an Auto Scaling group needs a configuration file in order to operate. The instances are created and managed by AWS CloudFormation. A DevOps engineer needs instances to receive the latest configuration file at launch and needs configuration-file changes to reach every instance with minimal delay when the CloudFormation template is updated. Company policy requires application configuration files to be maintained in source control together with AWS infrastructure configuration files.

Which solution will accomplish this?

Explanation

AWS::CloudFormation::Init metadata can define and write the configuration file as part of the CloudFormation template. cfn-init reads that metadata and applies it when an instance launches. cfn-hup monitors CloudFormation resource metadata and runs configured hooks when it changes, allowing it to invoke cfn-init and apply updated configuration to running instances after a stack update.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!