CloudWatch
Alarms can be used to observe thresholds for data-of-interest, and trigger actions automatically. Please also consult the AWS docs on how alarms are evaluated in general. LocalStack currently supports metric-alarm evaluation with and comparison-operator
.
Metric alarms evaluate the state, by taking into account the data points of E.g. you can create this alarm:
And then add some data will cause a breach, and set the metric-alarm to state ALARM:
The alarm state should change to ALARM after a few seconds, and eventually go back to OK - as we configured to treat missing data points as “not breaching”.
Metric Alarm with Action
Here is an example with an alarm that will send a message to the defined topic once the alarm is in state ALARM. Note that the alarm-actions
requires a valid ARN of an existing SNS topic.
Known Limitations:
- values are ignored
- metric-streams are not supported