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:StopCanary` — stop future runs of the
8 * bound {@link Canary} (an in-flight run completes on its own); the canary
9 * name is injected automatically.
10 *
11 * Provide `Synthetics.StopCanaryHttp` on the hosting Lambda Function to
12 * satisfy the requirement.
13 * ### Controlling the Canary
14 * **Example:** Stop the Canary
15 * ```typescript
16 * // init — grants synthetics:StopCanary on the canary
17 * const stopCanary = yield* AWS.Synthetics.StopCanary(canary);
18 *
19 * // runtime — a ConflictException means it is not currently running
20 * yield* stopCanary().pipe(
21 * Effect.catchTag("ConflictException", () => Effect.void),
22 * );
23 * ```
24 *
25 * @binding
26 */
27export interface StopCanary extends Binding.Service<
28 StopCanary,
29 "AWS.Synthetics.StopCanary",
30 (
31 canary: Canary,
32 ) => Effect.Effect<
33 () => Effect.Effect<
34 synthetics.StopCanaryResponse,
35 synthetics.StopCanaryError
36 >
37 >
38> {}
39
40export const StopCanary = Binding.Service<StopCanary>(
41 "AWS.Synthetics.StopCanary",
42);