| 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 | import type { ExperimentTemplate } from "./ExperimentTemplate.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `fis:GetExperimentTemplate`. |
| 8 | * |
| 9 | * Reads the bound {@link ExperimentTemplate}'s full definition — targets, |
| 10 | * actions, stop conditions, log and report configuration — so a runtime |
| 11 | * function can inspect the experiment it is about to start. The template id |
| 12 | * is injected from the binding. Provide the implementation with |
| 13 | * `Effect.provide(AWS.FIS.GetExperimentTemplateHttp)`. |
| 14 | * ### Inspecting Templates |
| 15 | * **Example:** Read the Bound Template's Definition |
| 16 | * ```typescript |
| 17 | * // init — bind the operation to the experiment template |
| 18 | * const getExperimentTemplate = yield* AWS.FIS.GetExperimentTemplate(template); |
| 19 | * |
| 20 | * // runtime |
| 21 | * const { experimentTemplate } = yield* getExperimentTemplate(); |
| 22 | * console.log(Object.keys(experimentTemplate?.actions ?? {})); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetExperimentTemplate extends Binding.Service< |
| 28 | GetExperimentTemplate, |
| 29 | "AWS.FIS.GetExperimentTemplate", |
| 30 | ( |
| 31 | template: ExperimentTemplate, |
| 32 | ) => Effect.Effect< |
| 33 | () => Effect.Effect< |
| 34 | fis.GetExperimentTemplateResponse, |
| 35 | fis.GetExperimentTemplateError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetExperimentTemplate = Binding.Service<GetExperimentTemplate>( |
| 40 | "AWS.FIS.GetExperimentTemplate", |
| 41 | ); |