Skip to content

GetCanaryRuns

Source: src/AWS/Synthetics/GetCanaryRuns.ts

Runtime binding for synthetics:GetCanaryRuns — list the run results (status, timeline, artifact location) of the bound Canary; the canary name is injected automatically.

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

// init — grants synthetics:GetCanaryRuns on the canary
const getCanaryRuns = yield* AWS.Synthetics.GetCanaryRuns(canary);
// runtime
const { CanaryRuns } = yield* getCanaryRuns({ MaxResults: 10 });
const failed = CanaryRuns?.filter((run) => run.Status?.State === "FAILED");