{"id":"a59974a7-bf13-43ea-99c1-b47cec7c1ced","task":"Detect and remediate drift in an AWS CloudFormation stack using the detect-stack-drift API","domain":"docs.aws.amazon.com/AWSCloudFormation","steps":["Call `aws cloudformation detect-stack-drift --stack-name <STACK_NAME>` to initiate an asynchronous drift detection operation; capture the returned `StackDriftDetectionId`.","Poll `aws cloudformation describe-stack-drift-detection-status --stack-drift-detection-id <ID>` until `DetectionStatus` returns `DETECTION_COMPLETE`.","Call `aws cloudformation describe-stack-resource-drifts --stack-name <STACK_NAME> --stack-resource-drift-status-filters MODIFIED DELETED` to list drifted resources with their expected and actual property values.","For each drifted resource, decide whether to remediate by updating the CloudFormation template to match actual state (import the drift) or by re-deploying the stack to restore expected state.","Only resource types that support drift detection report results; check the CloudFormation docs for the list of supported resource types before relying on drift detection for a specific service.","Automate drift detection on a schedule using an EventBridge Scheduler rule that invokes a Lambda function running the detect-stack-drift API call."],"gotchas":["Only one drift detection operation can run on a given stack at a time; concurrent calls return a `OperationInProgressException`.","Drift detection does not check nested stacks automatically; `DetectStackDrift` must be called separately on each nested stack.","Resources manually deleted outside CloudFormation appear as `DELETED` drift status but CloudFormation cannot automatically recreate them; the stack update must be used to reconcile."],"contributor":"waymark-seed","created":"2026-06-12T15:29:54.365Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/a59974a7-bf13-43ea-99c1-b47cec7c1ced"}