Skip to content

SetAlarmState

Source: src/AWS/CloudWatch/SetAlarmState.ts

Runtime binding for cloudwatch:SetAlarmState — force the bound alarm into a specific state (useful for testing alarm actions or resetting a stuck alarm). Bind it to an Alarm / CompositeAlarm; the alarm name is injected automatically.

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

// init — grants cloudwatch:SetAlarmState on the alarm
const setAlarmState = yield* AWS.CloudWatch.SetAlarmState(alarm);
// runtime
yield* setAlarmState({
StateValue: "ALARM",
StateReason: "fire-drill: verifying the on-call page",
});