| 1 | import type * as fis from "@distilled.cloud/aws/fis"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `fis:UpdateSafetyLeverState`. |
| 7 | * |
| 8 | * Engages or disengages the account's safety lever — engaging it stops all |
| 9 | * running experiments and blocks new ones until it is disengaged, the |
| 10 | * account-wide chaos kill switch an ops function flips when a stop condition |
| 11 | * outside FIS's view fires. The account's lever has the well-known id |
| 12 | * `default`. Provide the implementation with |
| 13 | * `Effect.provide(AWS.FIS.UpdateSafetyLeverStateHttp)`. |
| 14 | * ### The Safety Lever |
| 15 | * **Example:** Halt All Experiments |
| 16 | * ```typescript |
| 17 | * // init — account-level binding, no resource argument |
| 18 | * const updateSafetyLeverState = yield* AWS.FIS.UpdateSafetyLeverState(); |
| 19 | * |
| 20 | * // runtime |
| 21 | * yield* updateSafetyLeverState({ |
| 22 | * id: "default", |
| 23 | * state: { status: "engaged", reason: "elevated error budget burn" }, |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface UpdateSafetyLeverState extends Binding.Service< |
| 30 | UpdateSafetyLeverState, |
| 31 | "AWS.FIS.UpdateSafetyLeverState", |
| 32 | () => Effect.Effect< |
| 33 | ( |
| 34 | request: fis.UpdateSafetyLeverStateRequest, |
| 35 | ) => Effect.Effect< |
| 36 | fis.UpdateSafetyLeverStateResponse, |
| 37 | fis.UpdateSafetyLeverStateError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const UpdateSafetyLeverState = Binding.Service<UpdateSafetyLeverState>( |
| 42 | "AWS.FIS.UpdateSafetyLeverState", |
| 43 | ); |