Skip to content

GetCanary

Source: src/AWS/Synthetics/GetCanary.ts

Runtime binding for synthetics:GetCanary — read the full configuration and current status (state, last run, timeline) of the bound Canary; the canary name is injected automatically.

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

// init — grants synthetics:GetCanary on the canary
const getCanary = yield* AWS.Synthetics.GetCanary(canary);
// runtime
const { Canary } = yield* getCanary();
const state = Canary?.Status?.State;