Skip to content

GetQueryStatus

Source: src/AWS/InternetMonitor/GetQueryStatus.ts

Runtime binding for internetmonitor:GetQueryStatus — check whether a query started on the bound Monitor is QUEUED, RUNNING, SUCCEEDED, FAILED, or CANCELED; the monitor name is injected automatically.

Provide InternetMonitor.GetQueryStatusHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants internetmonitor:GetQueryStatus on the monitor
const getQueryStatus = yield* AWS.InternetMonitor.GetQueryStatus(monitor);
// runtime
const { Status } = yield* getQueryStatus({ QueryId: queryId }).pipe(
Effect.repeat({
schedule: Schedule.spaced("2 seconds"),
until: (r) => r.Status !== "QUEUED" && r.Status !== "RUNNING",
times: 10,
}),
);