| 1 | import * as Logs from "@distilled.cloud/aws/cloudwatch-logs"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeLogGroupHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { StopQuery } from "./StopQuery.ts"; |
| 5 | |
| 6 | export const StopQueryHttp = Layer.effect( |
| 7 | StopQuery, |
| 8 | makeLogGroupHttpBinding({ |
| 9 | tag: "AWS.Logs.StopQuery", |
| 10 | operation: Logs.stopQuery, |
| 11 | actions: ["logs:StopQuery"], |
| 12 | // logs:StopQuery does not support resource-level permissions — an |
| 13 | // exact log-group-ARN statement never matches (verified via the IAM |
| 14 | // policy simulator: allowed for StartQuery/GetQueryResults on the same |
| 15 | // ARN, implicitDeny for StopQuery). Grant on `*`. |
| 16 | iamResources: "all", |
| 17 | // Scoped by the query id returned from StartQuery. |
| 18 | injectLogGroupName: false, |
| 19 | }), |
| 20 | ); |