| 1 | import * as cloudwatch from "@distilled.cloud/aws/cloudwatch"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { AlarmResource } from "./binding-common.ts"; |
| 5 | |
| 6 | type AlarmResources = [AlarmResource, ...AlarmResource[]]; |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `cloudwatch:DisableAlarmActions` — suppress the |
| 10 | * actions of the bound alarms (e.g. during a deploy or maintenance |
| 11 | * window). Bind it to one or more {@link Alarm} / {@link CompositeAlarm} |
| 12 | * resources; the alarm names are injected automatically. Re-enable with |
| 13 | * {@link EnableAlarmActions}. |
| 14 | * |
| 15 | * Provide `CloudWatch.DisableAlarmActionsHttp` on the hosting Lambda |
| 16 | * Function to satisfy the requirement. |
| 17 | * ### Managing Alarm Actions |
| 18 | * **Example:** Mute an Alarm During a Deploy |
| 19 | * ```typescript |
| 20 | * // init — grants cloudwatch:DisableAlarmActions on the alarm |
| 21 | * const disableAlarmActions = yield* AWS.CloudWatch.DisableAlarmActions(alarm); |
| 22 | * |
| 23 | * // runtime |
| 24 | * yield* disableAlarmActions(); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface DisableAlarmActions extends Binding.Service< |
| 30 | DisableAlarmActions, |
| 31 | "AWS.CloudWatch.DisableAlarmActions", |
| 32 | ( |
| 33 | ...alarms: AlarmResources |
| 34 | ) => Effect.Effect< |
| 35 | () => Effect.Effect<cloudwatch.DisableAlarmActionsResponse, any> |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const DisableAlarmActions = Binding.Service<DisableAlarmActions>( |
| 40 | "AWS.CloudWatch.DisableAlarmActions", |
| 41 | ); |