1import * as cloudformation from "@distilled.cloud/aws/cloudformation";
2import * as Layer from "effect/Layer";
3import { makeCloudFormationStackHttpBinding } from "./BindingHttp.ts";
4import { DetectStackDrift } from "./DetectStackDrift.ts";
5
6export const DetectStackDriftHttp = Layer.effect(
7 DetectStackDrift,
8 makeCloudFormationStackHttpBinding({
9 tag: "AWS.CloudFormation.DetectStackDrift",
10 operation: cloudformation.detectStackDrift,
11 // DetectStackDrift authorizes BOTH actions on the stack — the per-stack
12 // call fans out to per-resource drift checks and AWS rejects the call
13 // with AccessDenied on cloudformation:DetectStackResourceDrift alone.
14 actions: [
15 "cloudformation:DetectStackDrift",
16 "cloudformation:DetectStackResourceDrift",
17 ],
18 }),
19);