Skip to content

GetDashboard

Source: src/AWS/CloudWatch/GetDashboard.ts

Runtime binding for cloudwatch:GetDashboard — read the body and metadata of the bound Dashboard; the dashboard name is injected automatically.

Provide CloudWatch.GetDashboardHttp on the hosting Lambda Function to satisfy the requirement.

// init — grants cloudwatch:GetDashboard on the dashboard
const getDashboard = yield* AWS.CloudWatch.GetDashboard(dashboard);
// runtime
const result = yield* getDashboard();
const widgets = JSON.parse(result.DashboardBody ?? "{}").widgets;