Repository navigation
Closed
Labels
area: cloudformationIssues relating to the CloudFormation componenttype: featureNew feature or improvement
Milestone
Description
Summary
Add drift detection: DetectStackDrift, DescribeStackDriftDetectionStatus, DescribeStackResourceDrifts.
Proposed implementation
Drift detection flow
- DetectStackDrift — for each resource in the stack, compare the current state (from the plugin's state manager) against the expected state (from the template + last applied parameters). Record any differences as drift.
- DescribeStackDriftDetectionStatus — return the status of a drift detection operation (IN_PROGRESS → DETECTION_COMPLETE)
- DescribeStackResourceDrifts — return per-resource drift details:
IN_SYNC,MODIFIED,DELETED,NOT_CHECKED
Drift is observable
Since substrate controls all state mutations, drift can only occur when:
- A resource is modified directly via API (e.g.,
UpdateTableafter stack creation) - A resource is deleted directly via API
- The stack template has parameter defaults that differ from applied values
This makes drift detection deterministic and testable — a key advantage over real AWS where drift is hard to reproduce.
Acceptance criteria
- DetectStackDrift compares actual vs. expected resource state
- DescribeStackResourceDrifts returns per-resource drift status
- Direct API modifications to stack-managed resources are detected as MODIFIED
- Direct API deletions of stack-managed resources are detected as DELETED
- Resources unchanged from template are reported as IN_SYNC
- Tests: create stack → modify resource directly → detect drift → verify MODIFIED
Metadata
Metadata
Assignees
Labels
area: cloudformationIssues relating to the CloudFormation componenttype: featureNew feature or improvement
Activity
Release v0.61.0: CloudFormation change sets and drift detection (#289, …
scttfrdmn commentedon May 30, 2026
Partially shipped in v0.61.0 — keeping open for the remaining acceptance criteria.
Done (
betty_cfn.go:654DetectStackDrift):CFNResourceDrift)DELETEDIN_SYNCIN_SYNC/DRIFTEDstack statusStill outstanding:
MODIFIEDdetection — drift currently only checks existence (DELETED) vs. presence (IN_SYNC); property-level comparison of actual vs. expected resource state is not implemented (noMODIFIEDstatus emitted anywhere inbetty_cfn.go)DescribeStackResourceDriftsoperationDescribeStackDriftDetectionStatusoperation (IN_PROGRESS → DETECTION_COMPLETE)MODIFIEDThe release commit title referenced
#290but the feature is incomplete, so this stays open.docs: document issue/milestone closing in release process
scttfrdmn commentedon Jun 2, 2026
Remaining acceptance criteria implemented in #301 (branch
feat/issues-290-293).#290 — see the PR for the full breakdown. For #290 specifically:
MODIFIEDis implemented and tested end-to-end for S3VersioningConfiguration; the other drift-checkable types stay existence-only because their deploy paths don't persist template-comparable properties (documented honestly in the PR +cfnDriftComparatorsdoc comment). Will close on merge via the PR'sCloses #290keyword.feat: complete VPC route tables (#293), advance CFN drift detection (#…
scttfrdmn commentedon Jun 2, 2026
Advanced in #301 — keeping open for the remaining acceptance criteria, consistent with the existing partial-ship tracking on this issue.
Now done (PR #301):
MODIFIEDdetection — implemented + tested end-to-end for S3VersioningConfiguration(deploy versioned bucket → change outside CFN →MODIFIEDwithPropertyDifferences), via the newcfnDriftComparatorsmapDescribeStackResourceDrifts(with status filter)DescribeStackDriftDetectionStatus(+StartStackDriftDetection;DETECTION_IN_PROGRESS → DETECTION_COMPLETE)MODIFIEDStill outstanding:
MODIFIEDfor the other drift-checkable types (DynamoDB/SQS/SNS/Lambda/IAM). These remain existence-only because their deploy paths don't persist template-comparable properties (SQS/SNS deploy name-only; DynamoDB/IAM/Lambda have property name/shape mismatches). Broadening requires a larger cross-plugin change to persist comparable properties in each plugin's state. ThecfnDriftComparatorsmap is structured so new comparators drop in once that data exists.PR #301
Closes #293only; #290 is left open by design.feat: complete VPC route tables (#293), advance CFN drift detection (#…
feat: property-level CFN drift MODIFIED for all drift-checkable types (…