DOP-C02 - Configuration Management and Infrastructure as Code (17% of the exam) - 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.

Exam traps in Configuration Management and Infrastructure as Code

Answers that look right on this material and are not. Each one is a distractor from a different question in the DOP-C02 bank for this domain.

  • Enable "AWS CloudTrail" data events on the stack resources and parse the trail to infer which properties operators changed outside the pipeline during incidents.

    Why it is wrong: CloudTrail records who made an API call but not whether the resulting live state diverges from the template, so reconstructing drift from raw events is laborious and unreliable for the reconciliation goal.

  • Add a "DeletionPolicy" of "Retain" to the security group so that the resource is preserved whenever the production stack is updated by the pipeline.

    Why it is wrong: "DeletionPolicy" only controls what happens when a resource is removed from the template or the stack is deleted; it does not block in-place modification, so it fails the no-alteration requirement here.

  • Set the update behaviour to retain the failed resources so the stack stays in "UPDATE_FAILED" and the team can fix the resource in place afterwards.

    Why it is wrong: Retaining failed resources is useful for debugging but leaves the stack in a failed state requiring manual repair, which is the opposite of the hands-off automatic restoration required.

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