Skip to content

DescribeCanariesLastRun

Source: src/AWS/Synthetics/DescribeCanariesLastRun.ts

Runtime binding for synthetics:DescribeCanariesLastRun — read the most recent run of every canary in the account (optionally filtered by Names), e.g. to render a fleet-wide status page.

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

// init — grants synthetics:DescribeCanariesLastRun
const describeCanariesLastRun =
yield* AWS.Synthetics.DescribeCanariesLastRun();
// runtime
const { CanariesLastRun } = yield* describeCanariesLastRun();
const failing = CanariesLastRun?.filter(
(c) => c.LastRun?.Status?.State === "FAILED",
);