DescribeAlarmsForMetric
Source:
src/AWS/CloudWatch/DescribeAlarmsForMetric.ts
Runtime binding for cloudwatch:DescribeAlarmsForMetric — find the
alarms watching a specific metric.
Provide CloudWatch.DescribeAlarmsForMetricHttp on the hosting Lambda
Function to satisfy the requirement.
Reading Alarm State
Section titled “Reading Alarm State”// init — grants cloudwatch:DescribeAlarmsForMetricconst describeAlarmsForMetric = yield* AWS.CloudWatch.DescribeAlarmsForMetric();
// runtimeconst result = yield* describeAlarmsForMetric({ Namespace: "MyApp/Payments", MetricName: "PaymentProcessed", Statistic: "Sum", Period: 60,});const alarmNames = (result.MetricAlarms ?? []).map((a) => a.AlarmName);