DOP-C02 - Configuration Management and Infrastructure as Code - Section 2.4

Detect and remediate configuration drift and manage resource lifecycle using CloudFormation drift detection, deletion and update-replace policies and AWS Config.

Use CloudFormation drift detection and AWS Config rules to identify resources that have diverged from their declared state and trigger remediation. Apply DeletionPolicy and update-replace policies to control whether a resource is retained, snapshotted, or replaced during a stack operation.

Drift detectionDeletionPolicyAWS ConfigUpdate behaviours

Practice question for this objective

Free sampleConfiguration Management and Infrastructure as Codemedium

A compliance team suspects that someone changed production resources through the console outside of the "AWS CloudFormation" pipeline, leaving the deployed configuration out of step with the templates. They need a repeatable way to identify exactly which stack resources and properties no longer match what CloudFormation provisioned, so the differences can be reconciled. Which approach MOST directly surfaces these unmanaged out-of-band changes?

  • ACreate a change set against the current template and inspect the listed resource modifications to find the out-of-band changes.
  • BEnable a stack policy that denies modifications so future console changes are blocked and the existing differences become visible.
  • CRun drift detection on the stack and review the drift results to see which resources and properties differ from their expected template configuration. Correct
  • DRe-run the original template as a fresh stack update so any console changes are overwritten and revealed by the resources that get modified.
Use CloudFormation drift detection to identify which stack resources and properties differ from their expected template configuration. Drift detection inspects the running stack and compares each supported resource and its properties to the configuration CloudFormation last provisioned from the template, returning a drift status and the specific differing properties; this is the purpose-built way to find changes made outside the pipeline.

Why A is wrong: A change set compares the deployed stack to a proposed template, not to its actual live configuration, so manual console edits that match the template logically will not appear as differences.

Why B is wrong: A stack policy only governs updates made through CloudFormation, not direct console edits, and it neither detects nor reports configuration that has already drifted.

Why C is correct: Drift detection compares each stack resource against its expected template configuration and reports the specific resources and properties that differ, which is exactly how out-of-band changes are surfaced for reconciliation.

Why D is wrong: Re-applying the template would silently overwrite the manual changes rather than first reporting them, which loses the audit detail the compliance team needs to reconcile the differences.

See more DOP-C02 practice questions, answers explained.

More in this domain

Back to all Configuration Management and Infrastructure as Code objectives, or the DOP-C02 cert hub.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.