Question

Difficulty: MediumAWS CloudFormation Stack and Drift Management

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?

  1. Modify the DB instance configuration directly in the Amazon RDS console to match the expected values defined in the CloudFormation template.Answer
  2. Update the CloudFormation template to match the current DB instance class and backup retention period, and then perform a stack update.Answer
  3. C
    Delete the CloudFormation stack and use the resource import feature to create a new stack from the drifted RDS instance.
  4. D
    Execute the `aws cloudformation continue-update-rollback` command with the `--remediate-drift` parameter specified.
  5. E
    Attach 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

1
Review the drift detection report to identify the drifted resources and their specific configuration changes.
The DB instance is found to have a different instance class and backup retention period compared to the expected template.
This determines the exact deviations that must be corrected to restore stack alignment.
2
Decide whether to revert the changes or accept them as the new baseline configuration.
Determined the appropriate path for drift resolution.
Allows selecting the correct remediation strategy based on business requirements.
3
Execute the chosen remediation strategy: either manually update the RDS instance in the console to match the template, or update the template and perform a CloudFormation stack update.
The drift is resolved, and the stack's status returns to IN_SYNC.
Synchronizes the stack definition and physical resources.

Key Concept

CloudFormation resource drift remediation
Rate this question