Soru

Zorluk: OrtaAWS CloudFormation Stack and Drift Management

A SysOps Administrator uses an AWS CloudFormation stack to manage an Amazon S3 bucket used for public asset hosting. A developer manually modified the bucket's CORS (Cross-Origin Resource Sharing) configuration directly in the Amazon S3 console to enable access for a new partner domain. The administrator runs drift detection on the stack and identifies that the S3 bucket is in a drifted state. The administrator wants to resolve the drift and align the stack and the S3 bucket configuration.

Which of the following actions can the administrator take to remediate the drift? (Select TWO.)

  1. Manually revert the CORS configuration on the S3 bucket to match the configuration specified in the CloudFormation template.Cevap
  2. Update the CloudFormation template to include the new CORS configuration, and then perform a stack update using the updated template.Cevap
  3. C
    Execute the `aws cloudformation resolve-drift` command with the S3 bucket's physical ID to automatically sync the bucket back to the template state.
  4. D
    Perform a 'Continue update rollback' operation on the stack to force the S3 bucket properties to revert to the template definitions.
  5. E
    Associate an AWS Config rule with the stack that uses an automated Systems Manager remediation document to redeploy the stack template.

Cevap

The administrator can resolve the drift by manually reverting the S3 bucket's CORS configuration to match the template, or by updating the template to include the new CORS configuration and running a stack update.
The correct remediation steps are to either manually revert the CORS configuration on the S3 bucket to match the template definition, or to update the template to reflect the manual changes and run a stack update. These are the two standard ways to align drifted resources with the stack configuration in CloudFormation.

Adım Adım Çözüm

1
Analyze the drift detection report to identify which resource and properties have drifted.
The S3 bucket CORS configuration is identified as drifted.
Before remediating, you must know what configuration values differ from the template.
2
Evaluate the desired state of the resource (whether the manual changes should be kept or discarded).
Determine if the developer's changes are valid and should be codified, or if they should be undone.
If the developer's changes are temporary or incorrect, they should be undone. If they are permanent, they must be incorporated into the stack template.
3
Execute the appropriate remediation method.
Either manually revert the S3 bucket's CORS configuration to match the template, or update the template to match the configuration and perform a stack update.
These are the two officially supported ways to resolve CloudFormation drift.

Anahtar Kavram

CloudFormation Drift Remediation
Tahmini Süre:1m 30s
Bu soruyu puanla