1import type * as synthetics from "@distilled.cloud/aws/synthetics";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Canary } from "./Canary.ts";
5
6/**
7 * Runtime binding for `synthetics:StartCanary` — start the bound
8 * {@link Canary} running on its configured schedule (e.g. trigger an
9 * on-demand smoke test after a deployment); the canary name is injected
10 * automatically.
11 *
12 * Provide `Synthetics.StartCanaryHttp` on the hosting Lambda Function to
13 * satisfy the requirement.
14 * ### Controlling the Canary
15 * **Example:** Start the Canary
16 * ```typescript
17 * // init — grants synthetics:StartCanary on the canary
18 * const startCanary = yield* AWS.Synthetics.StartCanary(canary);
19 *
20 * // runtime — a ConflictException means it is already starting/running
21 * yield* startCanary().pipe(
22 * Effect.catchTag("ConflictException", () => Effect.void),
23 * );
24 * ```
25 *
26 * @binding
27 */
28export interface StartCanary extends Binding.Service<
29 StartCanary,
30 "AWS.Synthetics.StartCanary",
31 (
32 canary: Canary,
33 ) => Effect.Effect<
34 () => Effect.Effect<
35 synthetics.StartCanaryResponse,
36 synthetics.StartCanaryError
37 >
38 >
39> {}
40
41export const StartCanary = Binding.Service<StartCanary>(
42 "AWS.Synthetics.StartCanary",
43);