Skip to content

StopCanary

Source: src/AWS/Synthetics/StopCanary.ts

Runtime binding for synthetics:StopCanary — stop future runs of the bound Canary (an in-flight run completes on its own); the canary name is injected automatically.

Provide Synthetics.StopCanaryHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants synthetics:StopCanary on the canary
const stopCanary = yield* AWS.Synthetics.StopCanary(canary);
// runtime — a ConflictException means it is not currently running
yield* stopCanary().pipe(
Effect.catchTag("ConflictException", () => Effect.void),
);