Question

Difficulty: MediumAWS CloudFormation Stack and Drift Management

A SysOps Administrator is managing an infrastructure deployment using an AWS CloudFormation stack. A recent drift detection scan reveals that several resources, including an Amazon EC2 instance and an EC2 security group, are in a MODIFIED state due to manual configuration changes made by the operations team. The administrator is planning to perform a stack update using a modified CloudFormation template.

Which two statements correctly describe how CloudFormation will handle the drifted resources during the stack update? (Select two.)

  1. If the stack update template modifies a property of a drifted resource that was manually changed, CloudFormation overwrites the manual change with the value specified in the new template.Answer
  2. If the stack update template does not modify the properties of a drifted resource, the manual changes to those properties are preserved.Answer
  3. C
    CloudFormation automatically blocks the stack update execution if any resource in the stack has a status of MODIFIED until drift is resolved.
  4. D
    CloudFormation automatically reverts all manual changes to match the original template configuration before applying the new template updates.
  5. E
    CloudFormation automatically fails the update and rolls back the stack if it detects that any resource has drifted during the update process.

Answer

If the stack update template modifies a property of a drifted resource that was manually changed, CloudFormation overwrites the manual change with the value specified in the new template. If the stack update template does not modify the properties of a drifted resource, the manual changes to those properties are preserved.
The correct answers describe the official behavior of AWS CloudFormation during a stack update. Specifically, if a property that has drifted is modified by the new template, CloudFormation updates the property to the value defined in the template, overwriting the manual change. If the properties are not modified by the template, CloudFormation leaves them alone, preserving the manual changes.

Step-by-Step Solution

1
Analyze how AWS CloudFormation processes stack updates in relation to resource drift.
Identify that CloudFormation updates resources according to the configuration specified in the template.
This establishes the fundamental behavior that CloudFormation does not perform automatic drift reconciliation during an update.
2
Evaluate the behavior when the update template modifies a drifted property.
Determine that CloudFormation will apply the template's specified value, overwriting any manual (drifted) change.
This explains the remediation or overwriting mechanism during stack updates.
3
Evaluate the behavior when the update template does not modify the drifted property.
Determine that CloudFormation leaves the resource unchanged, thereby preserving the manual changes.
This confirms that unmodified resources/properties are not touched by the stack update process.

Key Concept

AWS CloudFormation Drift Behavior During Stack Updates
Rate this question