A SysOps Administrator runs drift detection on an AWS CloudFormation stack that manages a production environment. The drift detection report indicates that an Amazon RDS DB instance is in the DRIFTED state because a developer manually updated the DB instance class and changed the backup retention period directly in the Amazon RDS console.
Which two actions should the Administrator take to resolve this resource drift and bring the stack and the DB instance back into alignment?
- Modify the DB instance configuration directly in the Amazon RDS console to match the expected values defined in the CloudFormation template.Answer
- Update the CloudFormation template to match the current DB instance class and backup retention period, and then perform a stack update.Answer
- CDelete the CloudFormation stack and use the resource import feature to create a new stack from the drifted RDS instance.
- DExecute the `aws cloudformation continue-update-rollback` command with the `--remediate-drift` parameter specified.
- EAttach an IAM policy to the CloudFormation execution role that grants the `iam:PassRole` permission for the RDS service role.
Answer
To resolve the resource drift, the Administrator can either revert the manual changes directly in the Amazon RDS console to match the expected template values, or update the CloudFormation template to reflect the new resource properties and perform a stack update.
The correct actions to remediate resource drift are either to modify the actual resource configuration (reverting manual changes) to match the CloudFormation template's expected state, or to modify the CloudFormation template to match the current actual state of the resource and run a stack update.
Step-by-Step Solution
Key Concept
CloudFormation resource drift remediation