A company manages its infrastructure using AWS CloudFormation stacks. A Solutions Architect notices that some Amazon EC2 instances and security groups have been modified manually outside of CloudFormation, creating configuration drift. The Solutions Architect wants to detect these changes and ensure future configuration consistency for both the AWS resource properties and the operating system configurations inside the EC2 instances. Which two actions should the Solutions Architect take to meet these requirements?
- Run drift detection on the AWS CloudFormation stacks to identify which AWS resource properties have diverged from the stack templates.Answer
- Create an AWS Systems Manager State Manager association to regularly apply and enforce the desired operating system configurations on the EC2 instances.Answer
- CModify the Service Control Policies (SCPs) at the organizational level to automatically revert EC2 instance properties to their launch configuration when drift occurs.
- DEnable AWS Config rules with AWS KMS managed keys to automatically re-encrypt and redeploy the CloudFormation templates when template drift is detected.
- EConfigure AWS CodeDeploy with a linear deployment strategy to recreate the CloudFormation stack resources whenever a resource status changes.
Answer
Run drift detection on the AWS CloudFormation stacks to identify resource-level changes, and create an AWS Systems Manager State Manager association to enforce operating system configurations on the EC2 instances.
The correct solution involves using CloudFormation's native drift detection to identify out-of-band infrastructure changes, combined with AWS Systems Manager State Manager to enforce operating system configurations on the EC2 instances.
Step-by-Step Solution
Key Concept
Continuous configuration management and drift detection across AWS resources and guest operating systems.