A SysOps Administrator performs a drift detection operation on an AWS CloudFormation stack containing an Amazon EC2 instance and a Security Group. The drift detection report indicates that the stack is DRIFTED because a new inbound port was manually added to the Security Group. Which two methods can the administrator use to resolve the drift and align the stack's actual configuration with its expected template configuration? (Select TWO.)
- Manually remove the inbound port from the Security Group, then run drift detection on the stack again.Cevap
- Update the CloudFormation stack using a modified template that includes the new inbound port configuration.Cevap
- CExecute the AWS CLI command detect-stack-drift with the --remediate parameter to automatically revert the manual changes.
- DApply a CloudFormation stack policy that blocks updates to the Security Group to trigger an automatic rollback to the template definition.
- EConfigure the stack's IAM service role to grant iam:PassRole permissions, enabling the CloudFormation drift detection tool to rewrite the Security Group rules.
Cevap
Manually removing the inbound port from the Security Group and running drift detection again, or updating the CloudFormation stack using a modified template that includes the new inbound port configuration.
To resolve resource drift, a SysOps Administrator can either change the resource manually to match the expected template configuration, or update the template to match the actual resource configuration and perform a stack update. Manually removing the inbound port or updating the template to include the new port both bring the resource and template configurations back into alignment.
Adım Adım Çözüm
Anahtar Kavram
Remediating resource drift in AWS CloudFormation by either reverting out-of-band changes manually or updating the stack template to match the actual configuration.