Topic lessonTopic: IaC and CloudFormation: configuration, changes and drift
CloudFormation drift detection: IN_SYNC, NOT_CHECKED and coverage
Drift is a difference between configuration expected by CloudFormation and the actual resource configuration. Finishing a check, finding matching properties and proving everything safe are different claims. Read status, coverage and observation time together using three synthetic resources.
Distinguish operation, resource and stack statuses; explain coverage limits involving unchecked resources, properties, nested stacks and observation times.
A template defines the expected configuration; a stack manages resources together. Settings can also be changed manually. The records below are teaching examples, not observations from AWS.
Separate operation, resource and stack status
| Level | Typical statuses | How to read it |
|---|---|---|
| Detection operation | DETECTION_IN_PROGRESS / DETECTION_COMPLETE / DETECTION_FAILED | Whether detection is running, completed for supported resources, or encountered failure. |
| Resource | IN_SYNC / MODIFIED / DELETED / NOT_CHECKED | Matching, modified or deleted configuration, or not checked. |
| Stack | IN_SYNC / DRIFTED / NOT_CHECKED | Aggregate result for supported resources, or not checked. |
Fixed example: a completed operation can include drift and unchecked resources
| Resource | Support and check condition | Result | Conclusion |
|---|---|---|---|
| A | Supported and compared. | IN_SYNC | The checked configuration matches. |
| B | Supported; a difference was found. | MODIFIED | Inspect expected versus actual values. |
| C | Unsupported in this example. | Not checked | A match has not been established. |
- Detection operation → Resource findingsInspect findings
- Resource findings → Overall interpretationAggregate with scope
- Detection operation
- Checks supported A and B
- Resource findings
- A matches; B differs; C unchecked
- Overall interpretation
- DRIFTED; C remains unchecked
The operation can be DETECTION_COMPLETE after successfully checking A and B, while the stack is DRIFTED because B differs. C has not been checked. This is a conceptual table, not a literal API response.
Check what IN_SYNC leaves outside the comparison
Detection is limited to supported resources and comparable properties. Distinguish explicitly defined values from service defaults. Checking a parent stack does not inspect the contents of its nested stacks.
| Coverage detail | Question |
|---|---|
| Resources | Which were in scope? Separate unsupported, failed and excluded items. |
| Properties | Were important values explicit and comparable? |
| Related stacks | Are there nested stacks or attachments from other stacks? |
| Time | Do these results belong to the current check? Inspect per-resource timestamps too. |
Do not treat failed checks or stale results as matches
DETECTION_FAILED means at least part of the operation failed. Successfully checked resources may still have results, but failed coverage remains unresolved. An empty list does not prove there is no difference; investigate read permissions and retrieval failures.
Match the stack, logical and physical resource IDs, and timestamps. An individual-resource check can affect the stack-level display; that does not establish that every resource was rechecked at the same time.
Detection is not repair: reconcile with intent
When a difference is found, establish why it exists. Blindly restoring an old definition can undo a necessary incident fix. Decide whether to update the definition or change the resource, including ownership and impact in the review.
Where supported, a drift-aware change set can preview differences involving actual state. Unsupported types and unreadable properties still limit coverage. Detection or preview creation does not itself repair resources or restore an application.
Practice reading status together with coverage
Choose an option to see the result and explanation.
Check, then explain in your own words
- Distinguish operation, resource and stack statuses.
- Explain how completed detection and DRIFTED can coexist.
- Record unchecked coverage and decisions needed before repair.
Check your understanding: What should accompany an IN_SYNC report?
Include resources and properties checked, unsupported or failed coverage, nested-stack scope and result timestamps.
A match is limited to the observed scope and time; it does not guarantee overall application or security health.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
Scope and conditionsSeparate operation/resource/stack statuses, zero-supported IN_SYNC, explicit/default properties, nesting, permissions and partial failure. Documentation review; not live AWS validation.
Used in this lessonSeparate operation, resource and stack status Fixed example: a completed operation can include drift and unchecked resources Check what IN_SYNC leaves outside the comparison Do not treat failed checks or stale results as matches Detection is not repair: reconcile with intent Practice reading status together with coverage
- DescribeStackResourceDriftsChecked:
Scope and conditionsUnchecked/unsupported resources can be omitted. Do not present a conceptual table as a literal API response; compare results with inventory. Documentation review; not live AWS validation.
Used in this lessonFixed example: a completed operation can include drift and unchecked resources Do not treat failed checks or stale results as matches Practice reading status together with coverage
- Detect drift on an entire stackChecked:
Scope and conditionsInspect scope, timestamps, identifiers and expected versus actual properties; match findings to the current check. Documentation review; not live AWS validation.
Used in this lessonFixed example: a completed operation can include drift and unchecked resources Check what IN_SYNC leaves outside the comparison Do not treat failed checks or stale results as matches Practice reading status together with coverage
Scope and conditionsA resource check can update the stack display without rechecking all resources together. Documentation review; not live AWS validation.
Used in this lessonCheck what IN_SYNC leaves outside the comparison Do not treat failed checks or stale results as matches Practice reading status together with coverage
- Using drift-aware change setsChecked:
Scope and conditionsThree-way comparison; unsupported types, write-only values, AWS-managed settings, external tags, immutable properties and cross-stack attachments limit reconciliation. Documentation review; not live AWS validation.
Used in this lessonDetection is not repair: reconcile with intent Practice reading status together with coverage
- Update stacks using change setsChecked:
Scope and conditionsSeparate preview creation from execution; validation does not guarantee runtime success. Documentation review; not live AWS validation.
Used in this lessonDetection is not repair: reconcile with intent