AWS Security ChangesHomeSearch

AWS cli documentation change

Service: cli · 2026-04-04 · Documentation low

File: cli/latest/reference/cloudwatch/put-metric-alarm.md

Summary

Updated AWS CLI version from 2.34.21 to 2.34.23 and added support for PromQL queries in CloudWatch alarms. Changes include: added PromQL as an alarm type, modified initial alarm state for PromQL alarms, made evaluation-periods and comparison-operator optional, added evaluation-criteria and evaluation-interval parameters, and updated documentation to reflect that alarms can now be created using EvaluationCriteria (PromQL) in addition to MetricName or Metrics array.

Security assessment

The changes are feature enhancements introducing PromQL query support for CloudWatch alarms. No security vulnerabilities, patches, or security-specific configurations are mentioned. The modifications are functional additions to extend alarm capabilities without addressing security weaknesses.

Diff

diff --git a/cli/latest/reference/cloudwatch/put-metric-alarm.md b/cli/latest/reference/cloudwatch/put-metric-alarm.md
index 7a47739a2..30fe7974b 100644
--- a//cli/latest/reference/cloudwatch/put-metric-alarm.md
+++ b//cli/latest/reference/cloudwatch/put-metric-alarm.md
@@ -15 +15 @@
-  * [AWS CLI 2.34.21 Command Reference](../../index.html) »
+  * [AWS CLI 2.34.23 Command Reference](../../index.html) »
@@ -60 +60 @@ First time using the AWS CLI? See the [User Guide](https://docs.aws.amazon.com/c
-Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, or Metrics Insights query. For more information about using a Metrics Insights query for an alarm, see [Create alarms on Metrics Insights queries](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Metrics_Insights_Alarm.html) .
+Creates or updates an alarm and associates it with the specified metric, metric math expression, anomaly detection model, Metrics Insights query, or PromQL query. For more information about using a Metrics Insights query for an alarm, see [Create alarms on Metrics Insights queries](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Metrics_Insights_Alarm.html) .
@@ -64 +64 @@ Alarms based on anomaly detection models cannot have Auto Scaling actions.
-When this operation creates an alarm, the alarm state is immediately set to `INSUFFICIENT_DATA` . The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.
+When this operation creates an alarm, the alarm state is immediately set to `INSUFFICIENT_DATA` . For PromQL alarms, the alarm state is instead immediately set to `OK` . The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.
@@ -107 +107 @@ See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/monito
-    --evaluation-periods <value>
+    [--evaluation-periods <value>]
@@ -110 +110 @@ See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/monito
-    --comparison-operator <value>
+    [--comparison-operator <value>]
@@ -115,0 +116,2 @@ See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/monito
+    [--evaluation-criteria <value>]
+    [--evaluation-interval <value>]
@@ -370 +372 @@ Syntax:
-> The name for the metric associated with the alarm. For each `PutMetricAlarm` operation, you must specify either `MetricName` or a `Metrics` array.
+> The name for the metric associated with the alarm. For each `PutMetricAlarm` operation, you must specify either `MetricName` , a `Metrics` array, or an `EvaluationCriteria` .
@@ -543 +545 @@ JSON Syntax:
-`--evaluation-periods` (integer) [required]
+`--evaluation-periods` (integer)
@@ -569 +571 @@ JSON Syntax:
-`--comparison-operator` (string) [required]
+`--comparison-operator` (string)
@@ -596,0 +599,4 @@ JSON Syntax:
+> ### Note
+> 
+> This parameter is not applicable to PromQL alarms.
+> 
@@ -619 +625 @@ JSON Syntax:
-> An array of `MetricDataQuery` structures that enable you to create an alarm based on the result of a metric math expression. For each `PutMetricAlarm` operation, you must specify either `MetricName` or a `Metrics` array.
+> An array of `MetricDataQuery` structures that enable you to create an alarm based on the result of a metric math expression. For each `PutMetricAlarm` operation, you must specify either `MetricName` , a `Metrics` array, or an `EvaluationCriteria` .
@@ -933,0 +940,80 @@ JSON Syntax:
+`--evaluation-criteria` (tagged union structure)
+
+> The evaluation criteria for the alarm. For each `PutMetricAlarm` operation, you must specify either `MetricName` , a `Metrics` array, or an `EvaluationCriteria` .
+> 
+> If you use the `EvaluationCriteria` parameter, you cannot include the `Namespace` , `MetricName` , `Dimensions` , `Period` , `Unit` , `Statistic` , `ExtendedStatistic` , `Metrics` , `Threshold` , `ComparisonOperator` , `ThresholdMetricId` , `EvaluationPeriods` , or `DatapointsToAlarm` parameters of `PutMetricAlarm` in the same operation. Instead, all evaluation parameters are defined within this structure.
+> 
+> For an example of how to use this parameter, see the **PromQL alarm** example on this page.
+> 
+> ### Note
+> 
+> This is a Tagged Union structure. Only one of the following top level keys can be set: `PromQLCriteria`.
+> 
+> PromQLCriteria -> (structure)
+>
+>> The PromQL criteria for the alarm evaluation.
+>> 
+>> Query -> (string) [required]
+>>
+>>> The PromQL query that the alarm evaluates. The query must return a result of vector type. Each entry in the vector result represents an alarm contributor.
+>>> 
+>>> Constraints:
+>>> 
+>>>   * min: `1`
+>>>   * max: `10000`
+>>> 
+
+>> 
+>> PendingPeriod -> (integer)
+>>
+>>> The duration, in seconds, that a contributor must be continuously breaching before it transitions to the `ALARM` state.
+>>> 
+>>> Constraints:
+>>> 
+>>>   * min: `0`
+>>>   * max: `86400`
+>>> 
+
+>> 
+>> RecoveryPeriod -> (integer)
+>>
+>>> The duration, in seconds, that a contributor must continuously not be breaching before it transitions back to the `OK` state.
+>>> 
+>>> Constraints:
+>>> 
+>>>   * min: `0`
+>>>   * max: `86400`
+>>> 
+
+
+Shorthand Syntax:
+    
+    
+    PromQLCriteria={Query=string,PendingPeriod=integer,RecoveryPeriod=integer}
+    
+
+JSON Syntax:
+    
+    
+    {
+      "PromQLCriteria": {
+        "Query": "string",
+        "PendingPeriod": integer,
+        "RecoveryPeriod": integer
+      }
+    }
+    
+
+`--evaluation-interval` (integer)
+
+> The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.
+> 
+> This parameter is required for alarms that use `EvaluationCriteria` , and cannot be specified for alarms configured with `MetricName` or `Metrics` .
+> 
+> Constraints:
+> 
+>   * min: `10`
+>   * max: `3600`
+> 
+
+
@@ -1085 +1171 @@ None
-  * [AWS CLI 2.34.21 Command Reference](../../index.html) »
+  * [AWS CLI 2.34.23 Command Reference](../../index.html) »