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.)
- 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
- If the stack update template does not modify the properties of a drifted resource, the manual changes to those properties are preserved.Answer
- CCloudFormation automatically blocks the stack update execution if any resource in the stack has a status of MODIFIED until drift is resolved.
- DCloudFormation automatically reverts all manual changes to match the original template configuration before applying the new template updates.
- ECloudFormation 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
Key Concept
AWS CloudFormation Drift Behavior During Stack Updates