Soru

Zorluk: OrtaAWS CloudFormation Stack and Drift Management

A SysOps Administrator manages an AWS CloudFormation stack that contains an Amazon EC2 instance. A developer manually changed the instance type from t3.microt3.micro to t3.smallt3.small and added a new tag with key EnvironmentEnvironment and value TestingTesting directly using the Amazon EC2 console. The administrator runs a drift detection scan on the stack, which reports the EC2 instance resource status as DRIFTED. The administrator wants to resolve this drift so that the CloudFormation stack matches the actual state of the running instance, and any future stack updates do not revert these changes. Which two actions should the administrator perform to resolve this drift? (Select TWO)

  1. Update the CloudFormation template to reflect the new instance type and the environment tag in the resource declaration.Cevap
  2. Perform a stack update using the modified template to bring the stack's expected configuration in sync with the actual state.Cevap
  3. C
    Use the CloudFormation resource import feature to import the drifted EC2 instance as a new resource in the stack.
  4. D
    Use the sync stack operation in the CloudFormation console to automatically update the template parameters with the drifted values.
  5. E
    Terminate the drifted EC2 instance from the EC2 console, and then run a stack update with rollback configuration enabled.

Cevap

Update the CloudFormation template to reflect the new instance type and the environment tag in the resource declaration, and perform a stack update using the modified template.
To resolve drift where manual changes are to be preserved, the SysOps Administrator must update the CloudFormation template to match the current real-world state of the resources. Once the template is updated, executing a stack update syncs the stack's expected configuration with the actual resource configuration without triggering any resource updates or interruptions.

Adım Adım Çözüm

1
Identify the drifted configuration by reviewing the drift detection results, noting the manual modifications to the instance type and tags.
Confirming the resource configuration details match the actual resource state.
This determines what changes need to be incorporated into the CloudFormation template.
2
Modify the CloudFormation template by changing the instance type property to the new value and adding the environment tag under the resource's properties block.
The CloudFormation template matches the current state of the running instance.
To remediate drift while keeping manual changes, the template must be updated to align with the actual resource state.
3
Run a CloudFormation stack update using the updated template.
The stack expected configuration is updated, and a subsequent drift scan will report the resource as in-sync.
This updates the CloudFormation stack database to match the new template configuration without modifying the running EC2 instance.

Anahtar Kavram

To resolve resource drift and keep the manual changes, the CloudFormation template must be updated to match the actual state of the resources, followed by running a stack update.
Tahmini Süre:1m 30s
Bu soruyu puanla