How to create cloudwatch alarm before there is data for metric?

Viewed 1615

I would like to create a cloudwatch alarm for the sns metric NumberOfMessagesPublished on a new sns topic. If I attempt to do this before I trigger the topic (and there is no data for it) then the option to create an alarm does not exist in the web console.

How can I do this with the web console? Is using a cli tool the only option?

4 Answers

Yes, it is possible. The AWS Official Documentation answers your question. Just to quote the relevant lines:

You can create an alarm for a custom metric before you've created that custom metric. For the alarm to be valid, you must include all of the dimensions for the custom metric in addition to the metric namespace and metric name in the alarm definition.

Related