Skip to content

DetectStackDrift

Source: src/AWS/CloudFormation/DetectStackDrift.ts

Runtime binding for the DetectStackDrift operation (IAM actions cloudformation:DetectStackDrift + cloudformation:DetectStackResourceDrift — AWS authorizes both on the per-stack call).

Bind this operation to a Stack to start drift detection from inside a function runtime — e.g. a scheduled drift monitor. Detection runs asynchronously; poll the returned StackDriftDetectionId with DescribeStackDriftDetectionStatus. Note that CloudFormation reads the live state of the stack’s resources with the caller’s credentials, so the function also needs read access to the resource types in the template for the detection to complete. Provide the implementation with Effect.provide(AWS.CloudFormation.DetectStackDriftHttp).

const detectStackDrift = yield* AWS.CloudFormation.DetectStackDrift(stack);
const { StackDriftDetectionId } = yield* detectStackDrift();