A SysOps Administrator manages an AWS CloudFormation stack that contains an Amazon EC2 instance. A developer manually changed the instance type from to and added a new tag with key and value directly using the Amazon EC2 console. The administrator runs a drift detection scan on the stack, which reports the EC2 instance resource status as DRIFTED. The administrator wants to resolve this drift so that the CloudFormation stack matches the actual state of the running instance, and any future stack updates do not revert these changes. Which two actions should the administrator perform to resolve this drift? (Select TWO)
- Update the CloudFormation template to reflect the new instance type and the environment tag in the resource declaration.Answer
- Perform a stack update using the modified template to bring the stack's expected configuration in sync with the actual state.Answer
- CUse the CloudFormation resource import feature to import the drifted EC2 instance as a new resource in the stack.
- DUse the sync stack operation in the CloudFormation console to automatically update the template parameters with the drifted values.
- ETerminate the drifted EC2 instance from the EC2 console, and then run a stack update with rollback configuration enabled.
Answer
Update the CloudFormation template to reflect the new instance type and the environment tag in the resource declaration, and perform a stack update using the modified template.
To resolve drift where manual changes are to be preserved, the SysOps Administrator must update the CloudFormation template to match the current real-world state of the resources. Once the template is updated, executing a stack update syncs the stack's expected configuration with the actual resource configuration without triggering any resource updates or interruptions.
Step-by-Step Solution
Key Concept
To resolve resource drift and keep the manual changes, the CloudFormation template must be updated to match the actual state of the resources, followed by running a stack update.
Estimated Time:1m 30s