A SysOps Administrator is managing an AWS CloudFormation stack that contains an Amazon RDS DB instance and an IAM role. A drift detection operation on the stack reports that both resources are in a DRIFTED status because of manual modifications. The Administrator needs to bring the stack and the physical resources back into alignment. Which of the following actions should the Administrator take to remediate this resource drift? (Select TWO.)
- Manually modify the RDS DB instance and the IAM role outside of CloudFormation to match the expected configurations defined in the stack template.Cevap
- Update the CloudFormation template or parameters to match the current manual configurations of the resources, and then perform a stack update.Cevap
- CRun the `aws cloudformation resolve-stack-drift` AWS CLI command to force the resources to synchronize with the stack template.
- DUpdate the stack using a service role that has `iam:PassRole` permissions to allow CloudFormation to automatically overwrite the manual changes to the IAM role.
- EInitiate a stack update using the original template, and enable the option to automatically recreate drifted resources during the update.
Cevap
Remediate the drift by either manually modifying the RDS DB instance and the IAM role outside of CloudFormation to match the template, or by updating the CloudFormation template to match the drifted resources and running a stack update.
To remediate resource drift in AWS CloudFormation, you can either manually modify the resources directly in their respective services to align with the template's expected configurations, or you can update the template and parameters to reflect the drifted configurations and perform a stack update. Modifying the resources manually resets them to the state defined in the template, while updating the template accepts the changes as the new source of truth.
Adım Adım Çözüm
Anahtar Kavram
CloudFormation drift detection identifies manual changes made to stack resources outside of CloudFormation. Remediation requires either manually reverting the changes on the resource or updating the template to reflect the current state and updating the stack.