A developer deployed an Amazon EC2 instance and an associated security group using an AWS CloudFormation stack. During a troubleshooting session, the developer manually added a new ingress rule to the security group using the AWS Management Console. The developer now wants to synchronize the CloudFormation stack with these changes to ensure future stack updates do not overwrite or fail due to this modification. Which action should the developer take to resolve this discrepancy?
- Run drift detection on the stack to identify the modifications, update the CloudFormation template to include the new ingress rule, and then perform a stack update.Cevap
- BPerform a stack update using the original template, expecting AWS CloudFormation to automatically detect the manual configuration and merge it into the stack state.
- CStore the modified security group rules in AWS Systems Manager Parameter Store, and reference them via a dynamic reference in the template to bypass future drift detection.
- DTrigger a stack rollback operation to force the CloudFormation stack to import the manual out-of-band changes into its current state.
Cevap
Run drift detection on the stack to identify the modifications, update the CloudFormation template to include the new ingress rule, and then perform a stack update.
The correct action is to first identify the drift using the drift detection feature of CloudFormation. Once the drift details are known, the developer must update the template to include the manual modifications and run a stack update. This synchronizes the template definition with the actual resource state without interrupting the service or overwriting the rule.
Adım Adım Çözüm
Anahtar Kavram
CloudFormation Drift Detection and Reconciliation
Tahmini Süre:1m 30s