1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
    /// Constructs a fluent builder for the [`PutMetricAlarm`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder) operation.
    ///
    /// - The fluent builder is configurable:
    ///   - [`alarm_name(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::alarm_name) / [`set_alarm_name(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_alarm_name):<br>required: **true**<br><p>The name for the alarm. This name must be unique within the Region.</p> <p>The name must contain only UTF-8 characters, and can't contain ASCII control characters</p><br>
    ///   - [`alarm_description(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::alarm_description) / [`set_alarm_description(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_alarm_description):<br>required: **false**<br><p>The description for the alarm.</p><br>
    ///   - [`actions_enabled(bool)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::actions_enabled) / [`set_actions_enabled(Option<bool>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_actions_enabled):<br>required: **false**<br><p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p><br>
    ///   - [`ok_actions(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::ok_actions) / [`set_ok_actions(Option<Vec::<String>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_ok_actions):<br>required: **false**<br><p>The actions to execute when this alarm transitions to an <code>OK</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p> <p><b>EC2 actions:</b></p> <ul>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li> </ul> <p><b>Autoscaling action:</b></p> <ul>  <li>   <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li> </ul> <p><b>Lambda actions:</b></p> <ul>  <li>   <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>  <li>   <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>  <li>   <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li> </ul> <p><b>SNS notification action:</b></p> <ul>  <li>   <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li> </ul> <p><b>SSM integration actions:</b></p> <ul>  <li>   <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>  <li>   <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li> </ul><br>
    ///   - [`alarm_actions(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::alarm_actions) / [`set_alarm_actions(Option<Vec::<String>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_alarm_actions):<br>required: **false**<br><p>The actions to execute when this alarm transitions to the <code>ALARM</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p> <p><b>EC2 actions:</b></p> <ul>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li> </ul> <p><b>Autoscaling action:</b></p> <ul>  <li>   <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li> </ul> <p><b>Lambda actions:</b></p> <ul>  <li>   <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>  <li>   <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>  <li>   <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li> </ul> <p><b>SNS notification action:</b></p> <ul>  <li>   <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li> </ul> <p><b>SSM integration actions:</b></p> <ul>  <li>   <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>  <li>   <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li> </ul><br>
    ///   - [`insufficient_data_actions(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::insufficient_data_actions) / [`set_insufficient_data_actions(Option<Vec::<String>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_insufficient_data_actions):<br>required: **false**<br><p>The actions to execute when this alarm transitions to the <code>INSUFFICIENT_DATA</code> state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:</p> <p><b>EC2 actions:</b></p> <ul>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:stop</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:terminate</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:reboot</code></p></li>  <li>   <p><code>arn:aws:automate:<i>region</i>:ec2:recover</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Stop/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Terminate/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Reboot/1.0</code></p></li>  <li>   <p><code>arn:aws:swf:<i>region</i>:<i>account-id</i>:action/actions/AWS_EC2.InstanceId.Recover/1.0</code></p></li> </ul> <p><b>Autoscaling action:</b></p> <ul>  <li>   <p><code>arn:aws:autoscaling:<i>region</i>:<i>account-id</i>:scalingPolicy:<i>policy-id</i>:autoScalingGroupName/<i>group-friendly-name</i>:policyName/<i>policy-friendly-name</i> </code></p></li> </ul> <p><b>Lambda actions:</b></p> <ul>  <li>   <p>Invoke the latest version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i> </code></p></li>  <li>   <p>Invoke a specific version of a Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>version-number</i> </code></p></li>  <li>   <p>Invoke a function by using an alias Lambda function: <code>arn:aws:lambda:<i>region</i>:<i>account-id</i>:function:<i>function-name</i>:<i>alias-name</i> </code></p></li> </ul> <p><b>SNS notification action:</b></p> <ul>  <li>   <p><code>arn:aws:sns:<i>region</i>:<i>account-id</i>:<i>sns-topic-name</i> </code></p></li> </ul> <p><b>SSM integration actions:</b></p> <ul>  <li>   <p><code>arn:aws:ssm:<i>region</i>:<i>account-id</i>:opsitem:<i>severity</i>#CATEGORY=<i>category-name</i> </code></p></li>  <li>   <p><code>arn:aws:ssm-incidents::<i>account-id</i>:responseplan/<i>response-plan-name</i> </code></p></li> </ul><br>
    ///   - [`metric_name(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::metric_name) / [`set_metric_name(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_metric_name):<br>required: **false**<br><p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p> <p>If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the <code>Namespace</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters. Instead, you specify all this information in the <code>Metrics</code> array.</p><br>
    ///   - [`namespace(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::namespace) / [`set_namespace(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_namespace):<br>required: **false**<br><p>The namespace for the metric associated specified in <code>MetricName</code>.</p><br>
    ///   - [`statistic(Statistic)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::statistic) / [`set_statistic(Option<Statistic>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_statistic):<br>required: **false**<br><p>The statistic for the metric specified in <code>MetricName</code>, other than percentile. For percentile statistics, use <code>ExtendedStatistic</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic,</code> but not both.</p><br>
    ///   - [`extended_statistic(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::extended_statistic) / [`set_extended_statistic(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_extended_statistic):<br>required: **false**<br><p>The extended statistic for the metric specified in <code>MetricName</code>. When you call <code>PutMetricAlarm</code> and specify a <code>MetricName</code>, you must specify either <code>Statistic</code> or <code>ExtendedStatistic</code> but not both.</p> <p>If you specify <code>ExtendedStatistic</code>, the following are valid values:</p> <ul>  <li>   <p><code>p90</code></p></li>  <li>   <p><code>tm90</code></p></li>  <li>   <p><code>tc90</code></p></li>  <li>   <p><code>ts90</code></p></li>  <li>   <p><code>wm90</code></p></li>  <li>   <p><code>IQM</code></p></li>  <li>   <p><code>PR(<i>n</i>:<i>m</i>)</code> where n and m are values of the metric</p></li>  <li>   <p><code>TC(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>  <li>   <p><code>TM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>  <li>   <p><code>TS(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li>  <li>   <p><code>WM(<i>X</i>%:<i>X</i>%)</code> where X is between 10 and 90 inclusive.</p></li> </ul> <p>For more information about these extended statistics, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html">CloudWatch statistics definitions</a>.</p><br>
    ///   - [`dimensions(Dimension)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::dimensions) / [`set_dimensions(Option<Vec::<Dimension>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_dimensions):<br>required: **false**<br><p>The dimensions for the metric specified in <code>MetricName</code>.</p><br>
    ///   - [`period(i32)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::period) / [`set_period(Option<i32>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_period):<br>required: **false**<br><p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 30, and any multiple of 60.</p> <p><code>Period</code> is required for alarms based on static thresholds. If you are creating an alarm based on a metric math expression, you specify the period for each metric within the objects in the <code>Metrics</code> array.</p> <p>Be sure to specify 10 or 30 only for metrics that are stored by a <code>PutMetricData</code> call with a <code>StorageResolution</code> of 1. If you specify a period of 10 or 30 for a metric that does not have sub-minute resolution, the alarm still attempts to gather data at the period rate that you specify. In this case, it does not receive data for the attempts that do not correspond to a one-minute data resolution, and the alarm might often lapse into INSUFFICENT_DATA status. Specifying 10 or 30 also sets this alarm as a high-resolution alarm, which has a higher charge than other alarms. For more information about pricing, see <a href="https://aws.amazon.com/cloudwatch/pricing/">Amazon CloudWatch Pricing</a>.</p> <p>An alarm's total current evaluation period can be no longer than one day, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> cannot be more than 86,400 seconds.</p><br>
    ///   - [`unit(StandardUnit)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::unit) / [`set_unit(Option<StandardUnit>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_unit):<br>required: **false**<br><p>The unit of measure for the statistic. For example, the units for the Amazon EC2 NetworkIn metric are Bytes because NetworkIn tracks the number of bytes that an instance receives on all network interfaces. You can also specify a unit when you create a custom metric. Units help provide conceptual meaning to your data. Metric data points that specify a unit of measure, such as Percent, are aggregated separately. If you are creating an alarm based on a metric math expression, you can specify the unit for each metric (if needed) within the objects in the <code>Metrics</code> array.</p> <p>If you don't specify <code>Unit</code>, CloudWatch retrieves all unit types that have been published for the metric and attempts to evaluate the alarm. Usually, metrics are published with only one unit, so the alarm works as intended.</p> <p>However, if the metric is published with multiple types of units and you don't specify a unit, the alarm's behavior is not defined and it behaves unpredictably.</p> <p>We recommend omitting <code>Unit</code> so that you don't inadvertently specify an incorrect unit that is not published for this metric. Doing so causes the alarm to be stuck in the <code>INSUFFICIENT DATA</code> state.</p><br>
    ///   - [`evaluation_periods(i32)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::evaluation_periods) / [`set_evaluation_periods(Option<i32>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_evaluation_periods):<br>required: **true**<br><p>The number of periods over which data is compared to the specified threshold. If you are setting an alarm that requires that a number of consecutive data points be breaching to trigger the alarm, this value specifies that number. If you are setting an "M out of N" alarm, this value is the N.</p> <p>An alarm's total current evaluation period can be no longer than one day, so this number multiplied by <code>Period</code> cannot be more than 86,400 seconds.</p><br>
    ///   - [`datapoints_to_alarm(i32)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::datapoints_to_alarm) / [`set_datapoints_to_alarm(Option<i32>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_datapoints_to_alarm):<br>required: **false**<br><p>The number of data points that must be breaching to trigger the alarm. This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation">Evaluating an Alarm</a> in the <i>Amazon CloudWatch User Guide</i>.</p><br>
    ///   - [`threshold(f64)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::threshold) / [`set_threshold(Option<f64>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_threshold):<br>required: **false**<br><p>The value against which the specified statistic is compared.</p> <p>This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.</p><br>
    ///   - [`comparison_operator(ComparisonOperator)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::comparison_operator) / [`set_comparison_operator(Option<ComparisonOperator>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_comparison_operator):<br>required: **true**<br><p>The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.</p> <p>The values <code>LessThanLowerOrGreaterThanUpperThreshold</code>, <code>LessThanLowerThreshold</code>, and <code>GreaterThanUpperThreshold</code> are used only for alarms based on anomaly detection models.</p><br>
    ///   - [`treat_missing_data(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::treat_missing_data) / [`set_treat_missing_data(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_treat_missing_data):<br>required: **false**<br><p>Sets how this alarm is to handle missing data points. If <code>TreatMissingData</code> is omitted, the default behavior of <code>missing</code> is used. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data">Configuring How CloudWatch Alarms Treats Missing Data</a>.</p> <p>Valid Values: <code>breaching | notBreaching | ignore | missing</code></p><note>  <p>Alarms that evaluate metrics in the <code>AWS/DynamoDB</code> namespace always <code>ignore</code> missing data even if you choose a different option for <code>TreatMissingData</code>. When an <code>AWS/DynamoDB</code> metric has missing data, alarms that evaluate that metric remain in their current state.</p> </note><br>
    ///   - [`evaluate_low_sample_count_percentile(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::evaluate_low_sample_count_percentile) / [`set_evaluate_low_sample_count_percentile(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_evaluate_low_sample_count_percentile):<br>required: **false**<br><p>Used only for alarms based on percentiles. If you specify <code>ignore</code>, the alarm state does not change during periods with too few data points to be statistically significant. If you specify <code>evaluate</code> or omit this parameter, the alarm is always evaluated and possibly changes state no matter how many data points are available. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#percentiles-with-low-samples">Percentile-Based CloudWatch Alarms and Low Data Samples</a>.</p> <p>Valid Values: <code>evaluate | ignore</code></p><br>
    ///   - [`metrics(MetricDataQuery)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::metrics) / [`set_metrics(Option<Vec::<MetricDataQuery>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_metrics):<br>required: **false**<br><p>An array of <code>MetricDataQuery</code> structures that enable you to create an alarm based on the result of a metric math expression. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code> or a <code>Metrics</code> array.</p> <p>Each item in the <code>Metrics</code> array either retrieves a metric or performs a math expression.</p> <p>One item in the <code>Metrics</code> array is the expression that the alarm watches. You designate this expression by setting <code>ReturnData</code> to true for this object in the array. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html">MetricDataQuery</a>.</p> <p>If you use the <code>Metrics</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, or <code>ExtendedStatistic</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the <code>Metrics</code> array.</p><br>
    ///   - [`tags(Tag)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::tags) / [`set_tags(Option<Vec::<Tag>>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_tags):<br>required: **false**<br><p>A list of key-value pairs to associate with the alarm. You can associate as many as 50 tags with an alarm. To be able to associate tags with the alarm when you create the alarm, you must have the <code>cloudwatch:TagResource</code> permission.</p> <p>Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.</p> <p>If you are using this operation to update an existing alarm, any tags you specify in this parameter are ignored. To change the tags of an existing alarm, use <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html">TagResource</a> or <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_UntagResource.html">UntagResource</a>.</p><br>
    ///   - [`threshold_metric_id(impl Into<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::threshold_metric_id) / [`set_threshold_metric_id(Option<String>)`](crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::set_threshold_metric_id):<br>required: **false**<br><p>If this is an alarm based on an anomaly detection model, make this value match the ID of the <code>ANOMALY_DETECTION_BAND</code> function.</p> <p>For an example of how to use this parameter, see the <b>Anomaly Detection Model Alarm</b> example on this page.</p> <p>If your alarm uses this parameter, it cannot have Auto Scaling actions.</p><br>
    /// - On success, responds with [`PutMetricAlarmOutput`](crate::operation::put_metric_alarm::PutMetricAlarmOutput)
    /// - On failure, responds with [`SdkError<PutMetricAlarmError>`](crate::operation::put_metric_alarm::PutMetricAlarmError)
    pub fn put_metric_alarm(&self) -> crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder {
        crate::operation::put_metric_alarm::builders::PutMetricAlarmFluentBuilder::new(self.handle.clone())
    }
}