Create a CloudWatch alarm based on a static threshold
You choose a CloudWatch metric for the alarm to watch, and the threshold for that
metric. The alarm goes to ALARM
state when the metric breaches the threshold for a specified
number of evaluation periods.
If you are creating an alarm in an account set up as a monitoring account in CloudWatch cross-account observability, you can set up the alarm to watch a metric in a source account linked to this monitoring account. For more information, see CloudWatch cross-account observability.
To create an alarm based on a single metric
Open the CloudWatch console at https://console.amazonaws.cn/cloudwatch/
. -
In the navigation pane, choose Alarms, All alarms.
-
Choose Create alarm.
-
Choose Select Metric.
Do one of the following:
-
Choose the service namespace that contains the metric that you want. Continue choosing options as they appear to narrow the choices. When a list of metrics appears, select the check box next to the metric that you want.
In the search box, enter the name of a metric, account ID, account label, dimension, or resource ID. Then, choose one of the results and continue until a list of metrics appears. Select the check box next to the metric that you want.
-
-
Choose the Graphed metrics tab.
-
Under Statistic , choose one of the statistics or predefined percentiles, or specify a custom percentile (for example,
p95.45
). -
Under Period, choose the evaluation period for the alarm. When evaluating the alarm, each period is aggregated into one data point.
You can also choose whether the y-axis legend appears on the left or right while you're creating the alarm. This preference is used only while you're creating the alarm.
-
Choose Select metric.
The Specify metric and conditions page appears, showing a graph and other information about the metric and statistic that you selected.
-
Under Conditions, specify the following:
-
For Whenever
metric
is, specify whether the metric must be greater than, less than, or equal to the threshold. Under than..., specify the threshold value. -
Choose Additional configuration. For Datapoints to alarm, specify how many evaluation periods (data points) must be in the
ALARM
state to trigger the alarm. If the two values here match, you create an alarm that goes toALARM
state if that many consecutive periods are breaching.To create an M out of N alarm, specify a lower number for the first value than you specify for the second value. For more information, see Evaluating an alarm.
For Missing data treatment, choose how to have the alarm behave when some data points are missing. For more information, see Configuring how CloudWatch alarms treat missing data.
-
If the alarm uses a percentile as the monitored statistic, a Percentiles with low samples box appears. Use it to choose whether to evaluate or ignore cases with low sample rates. If you choose ignore (maintain alarm state), the current alarm state is always maintained when the sample size is too low. For more information, see Percentile-based CloudWatch alarms and low data samples.
-
Choose Next.
-
Under Notification, select an SNS topic to notify when the alarm is in
ALARM
state,OK
state, orINSUFFICIENT_DATA
state.To have the alarm send multiple notifications for the same alarm state or for different alarm states, choose Add notification.
In CloudWatch cross-account observability, you can choose to have notifications sent to multiple Amazon accounts. For example, to both the monitoring account and the source account.
To have the alarm not send notifications, choose Remove.
To have the alarm perform Auto Scaling, EC2, Lambda, investigation, or Systems Manager actions, choose the appropriate button and choose the alarm state and action to perform. Alarms can perform Systems Manager actions and investigation actions only when they go into ALARM state. For more information about Systems Manager actions, see Configuring CloudWatch to create OpsItems from alarms and Incident creation.
To have the alarm start an investigation, choose Add investigation action and then select your investigation group. For more information about Amazon Q Developer operational investigations, see Amazon Q Developer operational investigations (Preview).
Note
To create an alarm that performs an SSM Incident Manager action, you must have certain permissions. For more information, see Identity-based policy examples for Amazon Systems Manager Incident Manager.
-
When finished, choose Next.
-
Enter a name and description for the alarm. The name must contain only UTF-8 characters, and can't contain ASCII control characters. The description can include markdown formatting, which is displayed only in the alarm Details tab in the CloudWatch console. The markdown can be useful to add links to runbooks or other internal resources. Then choose Next.
Under Preview and create, confirm that the information and conditions are what you want, then choose Create alarm.
You can also add alarms to a dashboard. For more information, see Adding an alarm to a CloudWatch dashboard.