The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as cloudwatch from "@distilled.cloud/aws/cloudwatch"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import type { AlarmResource } from "./binding-common.ts"; |
| 5 | |
| 6 | export interface SetAlarmStateRequest extends Omit<cloudwatch.SetAlarmStateInput, "AlarmName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `cloudwatch:SetAlarmState` — force the bound alarm |
| 10 | * into a specific state (useful for testing alarm actions or resetting a |
| 11 | * stuck alarm). Bind it to an {@link Alarm} / {@link CompositeAlarm}; the |
| 12 | * alarm name is injected automatically. |
| 13 | * |
| 14 | * Provide `CloudWatch.SetAlarmStateHttp` on the hosting Lambda Function to |
| 15 | * satisfy the requirement. |
| 16 | * ### Managing Alarm Actions |
| 17 | * **Example:** Force an Alarm into ALARM to Test Its Actions |
| 18 | * ```typescript |
| 19 | * // init — grants cloudwatch:SetAlarmState on the alarm |
| 20 | * const setAlarmState = yield* AWS.CloudWatch.SetAlarmState(alarm); |
| 21 | * |
| 22 | * // runtime |
| 23 | * yield* setAlarmState({ |
| 24 | * StateValue: "ALARM", |
| 25 | * StateReason: "fire-drill: verifying the on-call page", |
| 26 | * }); |
| 27 | * ``` |
| 28 | * |
| 29 | * @binding |
| 30 | */ |
| 31 | export interface SetAlarmState extends Binding.Service< |
| 32 | SetAlarmState, |
| 33 | "AWS.CloudWatch.SetAlarmState", |
| 34 | ( |
| 35 | alarm: AlarmResource, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: SetAlarmStateRequest, |
| 39 | ) => Effect.Effect<cloudwatch.SetAlarmStateResponse, cloudwatch.SetAlarmStateError> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const SetAlarmState = Binding.Service<SetAlarmState>("AWS.CloudWatch.SetAlarmState"); |