A developer is maintaining a testing environment deployed via an AWS CloudFormation stack. To resolve a connectivity issue, the developer manually modifies the inbound port rules of an Amazon EC2 security group directly through the Amazon VPC Console. The developer now wants to identify the discrepancies between the live resource configurations and the definition in the original CloudFormation template. Which CloudFormation feature or action should the developer use to identify these configuration discrepancies?
- AEdit the resource configurations directly using the AWS CLI to force synchronization with the template.
- BStore the security group configurations in Systems Manager Parameter Store to automatically track updates.
- Use CloudFormation drift detection on the stack to identify which resources have been modified outside of CloudFormation.Answer
- DRe-run the stack update and select the option to automatically roll back any out-of-band changes.
Answer
Use CloudFormation drift detection on the stack to identify which resources have been modified outside of CloudFormation.
Running drift detection allows CloudFormation to compare the current status of the stack resources with the expected status defined in the stack template. It flags any resources that have been modified outside of CloudFormation management, providing a clear list of discrepancies.
Step-by-Step Solution
Key Concept
AWS CloudFormation Drift Detection