Skip to content

put_metric_alarm async

put_metric_alarm(
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    alarm_name: Optional[AlarmName] = None,
    alarm_description: Optional[AlarmDescription] = None,
    actions_enabled: Optional[ActionsEnabled] = None,
    ok_actions: Optional[ResourceList] = None,
    alarm_actions: Optional[ResourceList] = None,
    insufficient_data_actions: Optional[ResourceList] = None,
    metric_name: Optional[MetricName] = None,
    namespace: Optional[Namespace] = None,
    statistic: Optional[Statistic] = None,
    extended_statistic: Optional[ExtendedStatistic] = None,
    dimensions: Optional[Dimensions] = None,
    period: Optional[Period] = None,
    unit: Optional[StandardUnit] = None,
    evaluation_periods: Optional[EvaluationPeriods] = None,
    datapoints_to_alarm: Optional[DatapointsToAlarm] = None,
    threshold: Optional[Threshold] = None,
    comparison_operator: Optional[ComparisonOperator] = None,
    treat_missing_data: Optional[TreatMissingData] = None,
    evaluate_low_sample_count_percentile: Optional[
        EvaluateLowSampleCountPercentile
    ] = None,
    metrics: Optional[MetricDataQueries] = None,
    tags: Optional[TagList] = None,
    threshold_metric_id: Optional[MetricId] = None,
    evaluation_window: Optional[EvaluationWindow] = None,
    warm_up_configuration: Optional[WarmUpConfiguration] = None,
    evaluation_criteria: Optional[EvaluationCriteria] = None,
    evaluation_interval: Optional[EvaluationInterval] = None,
) -> None

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.

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. 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.

When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations:

  • The iam:CreateServiceLinkedRole permission for all alarms with EC2 actions

  • The iam:CreateServiceLinkedRole permissions to create an alarm with Systems Manager OpsItem or response plan actions.

The first time you create an alarm in the Amazon Web Services Management Console, the CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called AWSServiceRoleForCloudWatchEvents and AWSServiceRoleForCloudWatchAlarms_ActionSSM. For more information, see Amazon Web Services service-linked role.

Each PutMetricAlarm action has a maximum uncompressed payload of 120 KB.

Cross-account alarms

You can set an alarm on metrics in the current account, or in another account. To create a cross-account alarm that watches a metric in a different account, you must have completed the following pre-requisites:

  • The account where the metrics are located (the sharing account) must already have a sharing role named CloudWatch-CrossAccountSharingRole. If it does not already have this role, you must create it using the instructions in Set up a sharing account in Cross-account cross-Region CloudWatch console. The policy for that role must grant access to the ID of the account where you are creating the alarm.

  • The account where you are creating the alarm (the monitoring account) must already have a service-linked role named AWSServiceRoleForCloudWatchCrossAccount to allow CloudWatch to assume the sharing role in the sharing account. If it does not, you must create it following the directions in Set up a monitoring account in Cross-account cross-Region CloudWatch console.

Parameters:

  • alarm_name (Optional[AlarmName], default: None ) –

    The name for the alarm. This name must be unique within the Region.

    The name must contain only UTF-8 characters, and can't contain ASCII control characters

  • alarm_description (Optional[AlarmDescription], default: None ) –

    The description for the alarm.

  • actions_enabled (Optional[ActionsEnabled], default: None ) –

    Indicates whether actions should be executed during any changes to the alarm state. The default is TRUE.

  • ok_actions (Optional[ResourceList], default: None ) –

    The actions to execute when this alarm transitions to an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:

    EC2 actions:

    • arn:aws:automate:region:ec2:stop

    • arn:aws:automate:region:ec2:terminate

    • arn:aws:automate:region:ec2:reboot

    • arn:aws:automate:region:ec2:recover

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0

    Autoscaling action:

    • arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name

    Lambda actions:

    • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name

    • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number

    • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name

    SNS notification action:

    • arn:aws:sns:region:account-id:sns-topic-name

    SSM integration actions:

    • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name

    • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name

  • alarm_actions (Optional[ResourceList], default: None ) –

    The actions to execute when this alarm transitions to the ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:

    EC2 actions:

    • arn:aws:automate:region:ec2:stop

    • arn:aws:automate:region:ec2:terminate

    • arn:aws:automate:region:ec2:reboot

    • arn:aws:automate:region:ec2:recover

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0

    Autoscaling action:

    • arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name

    Lambda actions:

    • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name

    • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number

    • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name

    SNS notification action:

    • arn:aws:sns:region:account-id:sns-topic-name

    SSM integration actions:

    • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name

    • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name

    Start a Amazon Q Developer operational investigation

    arn:aws:aiops:region:account-id:investigation-group:investigation-group-id

  • insufficient_data_actions (Optional[ResourceList], default: None ) –

    The actions to execute when this alarm transitions to the INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN). Valid values:

    EC2 actions:

    • arn:aws:automate:region:ec2:stop

    • arn:aws:automate:region:ec2:terminate

    • arn:aws:automate:region:ec2:reboot

    • arn:aws:automate:region:ec2:recover

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Reboot/1.0

    • arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Recover/1.0

    Autoscaling action:

    • arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name

    Lambda actions:

    • Invoke the latest version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name

    • Invoke a specific version of a Lambda function: arn:aws:lambda:region:account-id:function:function-name:version-number

    • Invoke a function by using an alias Lambda function: arn:aws:lambda:region:account-id:function:function-name:alias-name

    SNS notification action:

    • arn:aws:sns:region:account-id:sns-topic-name

    SSM integration actions:

    • arn:aws:ssm:region:account-id:opsitem:severity#CATEGORY=category-name

    • arn:aws:ssm-incidents::account-id:responseplan/response-plan-name

  • metric_name (Optional[MetricName], default: None ) –

    The name for the metric associated with the alarm. For each PutMetricAlarm operation, you must specify either MetricName, a Metrics array, or an EvaluationCriteria.

    If you are creating an alarm based on a math expression, you cannot specify this parameter, or any of the Namespace, Dimensions, Period, Unit, Statistic, or ExtendedStatistic parameters. Instead, you specify all this information in the Metrics array.

  • namespace (Optional[Namespace], default: None ) –

    The namespace for the metric associated specified in MetricName.

  • statistic (Optional[Statistic], default: None ) –

    The statistic for the metric specified in MetricName, other than percentile. For percentile statistics, use ExtendedStatistic. When you call PutMetricAlarm and specify a MetricName, you must specify either Statistic or ExtendedStatistic, but not both.

  • extended_statistic (Optional[ExtendedStatistic], default: None ) –

    The extended statistic for the metric specified in MetricName. When you call PutMetricAlarm and specify a MetricName, you must specify either Statistic or ExtendedStatistic but not both.

    If you specify ExtendedStatistic, the following are valid values:

    • p90

    • tm90

    • tc90

    • ts90

    • wm90

    • IQM

    • PR(n:m) where n and m are values of the metric

    • TC(X%:X%) where X is between 10 and 90 inclusive.

    • TM(X%:X%) where X is between 10 and 90 inclusive.

    • TS(X%:X%) where X is between 10 and 90 inclusive.

    • WM(X%:X%) where X is between 10 and 90 inclusive.

    For more information about these extended statistics, see CloudWatch statistics definitions.

  • dimensions (Optional[Dimensions], default: None ) –

    The dimensions for the metric specified in MetricName.

  • period (Optional[Period], default: None ) –

    The length, in seconds, used each time the metric specified in MetricName is evaluated. Valid values are 10, 20, 30, and any multiple of 60.

    Period 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 Metrics array.

    Be sure to specify 10, 20, or 30 only for metrics that are stored by a PutMetricData call with a StorageResolution of 1. If you specify a period of 10, 20, 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, 20, 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 Amazon CloudWatch Pricing.

    An alarm's total current evaluation period can be no longer than seven days, so Period multiplied by EvaluationPeriods can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).

  • unit (Optional[StandardUnit], default: None ) –

    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 Metrics array.

    If you don't specify Unit, 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.

    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.

    We recommend omitting Unit 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 INSUFFICIENT DATA state.

  • evaluation_periods (Optional[EvaluationPeriods], default: None ) –

    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.

  • datapoints_to_alarm (Optional[DatapointsToAlarm], default: None ) –

    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 Evaluating an Alarm in the Amazon CloudWatch User Guide.

  • threshold (Optional[Threshold], default: None ) –

    The value against which the specified statistic is compared.

    This parameter is required for alarms based on static thresholds, but should not be used for alarms based on anomaly detection models.

  • comparison_operator (Optional[ComparisonOperator], default: None ) –

    The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic value is used as the first operand.

    The values LessThanLowerOrGreaterThanUpperThreshold, LessThanLowerThreshold, and GreaterThanUpperThreshold are used only for alarms based on anomaly detection models.

  • treat_missing_data (Optional[TreatMissingData], default: None ) –

    Sets how this alarm is to handle missing data points. If TreatMissingData is omitted, the default behavior of missing is used. For more information, see Configuring How CloudWatch Alarms Treats Missing Data.

    Valid Values: breaching | notBreaching | ignore | missing

    Alarms that evaluate metrics in the AWS/DynamoDB namespace always ignore missing data even if you choose a different option for TreatMissingData. When an AWS/DynamoDB metric has missing data, alarms that evaluate that metric remain in their current state.

    This parameter is not applicable to PromQL alarms.

  • evaluate_low_sample_count_percentile (Optional[EvaluateLowSampleCountPercentile], default: None ) –

    Used only for alarms based on percentiles. If you specify ignore, the alarm state does not change during periods with too few data points to be statistically significant. If you specify evaluate 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 Percentile-Based CloudWatch Alarms and Low Data Samples.

    Valid Values: evaluate | ignore

  • metrics (Optional[MetricDataQueries], default: None ) –

    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.

    Each item in the Metrics array either retrieves a metric or performs a math expression.

    One item in the Metrics array is the expression that the alarm watches. You designate this expression by setting ReturnData to true for this object in the array. For more information, see MetricDataQuery.

    If you use the Metrics parameter, you cannot include the Namespace, MetricName, Dimensions, Period, Unit, Statistic, or ExtendedStatistic parameters of PutMetricAlarm in the same operation. Instead, you retrieve the metrics you are using in your math expression as part of the Metrics array.

  • tags (Optional[TagList], default: None ) –

    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 cloudwatch:TagResource permission.

    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.

    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 TagResource or UntagResource.

    To use this field to set tags for an alarm when you create it, you must be signed on with both the cloudwatch:PutMetricAlarm and cloudwatch:TagResource permissions.

  • threshold_metric_id (Optional[MetricId], default: None ) –

    If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function.

    For an example of how to use this parameter, see the Anomaly Detection Model Alarm example on this page.

    If your alarm uses this parameter, it cannot have Auto Scaling actions.

  • evaluation_window (Optional[EvaluationWindow], default: None ) –

    The evaluation window that the alarm uses to select the range of metric data that it evaluates. Specify either a sliding window or a wall clock window. If you omit this parameter, the alarm uses a sliding window.

    A sliding window advances each time the alarm is evaluated, forming a rolling time window. A wall clock window aligns the evaluated range to fixed clock boundaries, such as the top of the hour or the start of the day.

    You can use EvaluationWindow with any type of metric alarm except alarms that are based on a PromQL query.

    For more information, see Alarm evaluation windows in the CloudWatch User Guide.

  • warm_up_configuration (Optional[WarmUpConfiguration], default: None ) –

    The warm-up configuration for the alarm. A warm-up period delays alarm evaluation after you create or update the alarm. The warm-up period reduces alarm noise from missing data while a new resource or service starts publishing metrics.

    For more information, see Alarm warm-up periods in the Amazon CloudWatch User Guide.

  • evaluation_criteria (Optional[EvaluationCriteria], default: None ) –

    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.

  • evaluation_interval (Optional[EvaluationInterval], default: None ) –

    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.

Raises:

  • LimitExceededFault –

    The quota for alarms for this customer has already been reached.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_cloudwatch/_services/async_cloud_watch.py
async def put_metric_alarm(
    self,
    *,
    config_overrides: Optional[AsyncCloudWatchClientConfig] = None,
    alarm_name: Optional["capo_cloudwatch.types.alarm_name.AlarmName"] = None,
    alarm_description: Optional[
        "capo_cloudwatch.types.alarm_description.AlarmDescription"
    ] = None,
    actions_enabled: Optional[
        "capo_cloudwatch.types.actions_enabled.ActionsEnabled"
    ] = None,
    ok_actions: Optional["capo_cloudwatch.types.resource_list.ResourceList"] = None,
    alarm_actions: Optional[
        "capo_cloudwatch.types.resource_list.ResourceList"
    ] = None,
    insufficient_data_actions: Optional[
        "capo_cloudwatch.types.resource_list.ResourceList"
    ] = None,
    metric_name: Optional["capo_cloudwatch.types.metric_name.MetricName"] = None,
    namespace: Optional["capo_cloudwatch.types.namespace.Namespace"] = None,
    statistic: Optional["capo_cloudwatch.types.statistic.Statistic"] = None,
    extended_statistic: Optional[
        "capo_cloudwatch.types.extended_statistic.ExtendedStatistic"
    ] = None,
    dimensions: Optional["capo_cloudwatch.types.dimensions.Dimensions"] = None,
    period: Optional["capo_cloudwatch.types.period.Period"] = None,
    unit: Optional["capo_cloudwatch.types.standard_unit.StandardUnit"] = None,
    evaluation_periods: Optional[
        "capo_cloudwatch.types.evaluation_periods.EvaluationPeriods"
    ] = None,
    datapoints_to_alarm: Optional[
        "capo_cloudwatch.types.datapoints_to_alarm.DatapointsToAlarm"
    ] = None,
    threshold: Optional["capo_cloudwatch.types.threshold.Threshold"] = None,
    comparison_operator: Optional[
        "capo_cloudwatch.types.comparison_operator.ComparisonOperator"
    ] = None,
    treat_missing_data: Optional[
        "capo_cloudwatch.types.treat_missing_data.TreatMissingData"
    ] = None,
    evaluate_low_sample_count_percentile: Optional[
        "capo_cloudwatch.types.evaluate_low_sample_count_percentile.EvaluateLowSampleCountPercentile"
    ] = None,
    metrics: Optional[
        "capo_cloudwatch.types.metric_data_queries.MetricDataQueries"
    ] = None,
    tags: Optional["capo_cloudwatch.types.tag_list.TagList"] = None,
    threshold_metric_id: Optional[
        "capo_cloudwatch.types.metric_id.MetricId"
    ] = None,
    evaluation_window: Optional[
        "capo_cloudwatch.types.evaluation_window.EvaluationWindow"
    ] = None,
    warm_up_configuration: Optional[
        "capo_cloudwatch.types.warm_up_configuration.WarmUpConfiguration"
    ] = None,
    evaluation_criteria: Optional[
        "capo_cloudwatch.types.evaluation_criteria.EvaluationCriteria"
    ] = None,
    evaluation_interval: Optional[
        "capo_cloudwatch.types.evaluation_interval.EvaluationInterval"
    ] = None,
) -> None:
    """<p>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 <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Metrics_Insights_Alarm.html">Create alarms on Metrics Insights queries</a>.</p> <p>Alarms based on anomaly detection models cannot have Auto Scaling actions.</p> <p>When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>. For PromQL alarms, the alarm state is instead immediately set to <code>OK</code>. The alarm is then evaluated and its state is set appropriately. Any actions associated with the new state are then executed.</p> <p>When you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.</p> <p>If you are an IAM user, you must have Amazon EC2 permissions for some alarm operations:</p> <ul> <li> <p>The <code>iam:CreateServiceLinkedRole</code> permission for all alarms with EC2 actions</p> </li> <li> <p>The <code>iam:CreateServiceLinkedRole</code> permissions to create an alarm with Systems Manager OpsItem or response plan actions.</p> </li> </ul> <p>The first time you create an alarm in the Amazon Web Services Management Console, the CLI, or by using the PutMetricAlarm API, CloudWatch creates the necessary service-linked role for you. The service-linked roles are called <code>AWSServiceRoleForCloudWatchEvents</code> and <code>AWSServiceRoleForCloudWatchAlarms_ActionSSM</code>. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role">Amazon Web Services service-linked role</a>.</p> <p>Each <code>PutMetricAlarm</code> action has a maximum uncompressed payload of 120 KB.</p> <p> <b>Cross-account alarms</b> </p> <p>You can set an alarm on metrics in the current account, or in another account. To create a cross-account alarm that watches a metric in a different account, you must have completed the following pre-requisites:</p> <ul> <li> <p>The account where the metrics are located (the <i>sharing account</i>) must already have a sharing role named <b>CloudWatch-CrossAccountSharingRole</b>. If it does not already have this role, you must create it using the instructions in <b>Set up a sharing account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>. The policy for that role must grant access to the ID of the account where you are creating the alarm. </p> </li> <li> <p>The account where you are creating the alarm (the <i>monitoring account</i>) must already have a service-linked role named <b>AWSServiceRoleForCloudWatchCrossAccount</b> to allow CloudWatch to assume the sharing role in the sharing account. If it does not, you must create it following the directions in <b>Set up a monitoring account</b> in <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region"> Cross-account cross-Region CloudWatch console</a>.</p> </li> </ul>

    Args:
        alarm_name: <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>
        alarm_description: <p>The description for the alarm.</p>
        actions_enabled: <p>Indicates whether actions should be executed during any changes to the alarm state. The default is <code>TRUE</code>.</p>
        ok_actions: <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>
        alarm_actions: <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> <p> <b>Start a Amazon Q Developer operational investigation</b> </p> <p> <code>arn:aws:aiops:<i>region</i>:<i>account-id</i>:investigation-group:<i>investigation-group-id</i> </code> </p>
        insufficient_data_actions: <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>
        metric_name: <p>The name for the metric associated with the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</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>
        namespace: <p>The namespace for the metric associated specified in <code>MetricName</code>.</p>
        statistic: <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>
        extended_statistic: <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>
        dimensions: <p>The dimensions for the metric specified in <code>MetricName</code>.</p>
        period: <p>The length, in seconds, used each time the metric specified in <code>MetricName</code> is evaluated. Valid values are 10, 20, 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, 20, 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, 20, 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, 20, 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 seven days, so <code>Period</code> multiplied by <code>EvaluationPeriods</code> can't be more than 604,800 seconds. For alarms with a period of less than one hour (3,600 seconds), the total evaluation period can't be longer than one day (86,400 seconds).</p>
        unit: <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>
        evaluation_periods: <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>
        datapoints_to_alarm: <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>
        threshold: <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>
        comparison_operator: <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>
        treat_missing_data: <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> <note> <p>This parameter is not applicable to PromQL alarms.</p> </note>
        evaluate_low_sample_count_percentile: <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>
        metrics: <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>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</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>
        tags: <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> <p>To use this field to set tags for an alarm when you create it, you must be signed on with both the <code>cloudwatch:PutMetricAlarm</code> and <code>cloudwatch:TagResource</code> permissions.</p>
        threshold_metric_id: <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>
        evaluation_window: <p>The evaluation window that the alarm uses to select the range of metric data that it evaluates. Specify either a sliding window or a wall clock window. If you omit this parameter, the alarm uses a sliding window.</p> <p>A sliding window advances each time the alarm is evaluated, forming a rolling time window. A wall clock window aligns the evaluated range to fixed clock boundaries, such as the top of the hour or the start of the day.</p> <p>You can use <code>EvaluationWindow</code> with any type of metric alarm except alarms that are based on a PromQL query.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-evaluation-window.html">Alarm evaluation windows</a> in the <i>CloudWatch User Guide</i>.</p>
        warm_up_configuration: <p>The warm-up configuration for the alarm. A warm-up period delays alarm evaluation after you create or update the alarm. The warm-up period reduces alarm noise from missing data while a new resource or service starts publishing metrics.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/alarm-warm-up.html">Alarm warm-up periods</a> in the <i>Amazon CloudWatch User Guide</i>.</p>
        evaluation_criteria: <p>The evaluation criteria for the alarm. For each <code>PutMetricAlarm</code> operation, you must specify either <code>MetricName</code>, a <code>Metrics</code> array, or an <code>EvaluationCriteria</code>.</p> <p>If you use the <code>EvaluationCriteria</code> parameter, you cannot include the <code>Namespace</code>, <code>MetricName</code>, <code>Dimensions</code>, <code>Period</code>, <code>Unit</code>, <code>Statistic</code>, <code>ExtendedStatistic</code>, <code>Metrics</code>, <code>Threshold</code>, <code>ComparisonOperator</code>, <code>ThresholdMetricId</code>, <code>EvaluationPeriods</code>, or <code>DatapointsToAlarm</code> parameters of <code>PutMetricAlarm</code> in the same operation. Instead, all evaluation parameters are defined within this structure.</p> <p>For an example of how to use this parameter, see the <b>PromQL alarm</b> example on this page.</p>
        evaluation_interval: <p>The frequency, in seconds, at which the alarm is evaluated. Valid values are 10, 20, 30, and any multiple of 60.</p> <p>This parameter is required for alarms that use <code>EvaluationCriteria</code>, and cannot be specified for alarms configured with <code>MetricName</code> or <code>Metrics</code>.</p>

    Raises:
        capo_cloudwatch.errors.limit_exceeded_fault.LimitExceededFault: <p>The quota for alarms for this customer has already been reached.</p>
        capo_cloudwatch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch.types.put_metric_alarm_input.PutMetricAlarmInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_cloudwatch._operations.granite_service_version20100801.put_metric_alarm

        (
            output,
            http_response,
        ) = await capo_cloudwatch._operations.granite_service_version20100801.put_metric_alarm.async_put_metric_alarm(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutMetricAlarm")
    )
    input_: capo_cloudwatch.types.put_metric_alarm_input.PutMetricAlarmInput = {}
    if alarm_name is not None:
        input_["alarm_name"] = alarm_name
    if alarm_description is not None:
        input_["alarm_description"] = alarm_description
    if actions_enabled is not None:
        input_["actions_enabled"] = actions_enabled
    if ok_actions is not None:
        input_["ok_actions"] = ok_actions
    if alarm_actions is not None:
        input_["alarm_actions"] = alarm_actions
    if insufficient_data_actions is not None:
        input_["insufficient_data_actions"] = insufficient_data_actions
    if metric_name is not None:
        input_["metric_name"] = metric_name
    if namespace is not None:
        input_["namespace"] = namespace
    if statistic is not None:
        input_["statistic"] = statistic
    if extended_statistic is not None:
        input_["extended_statistic"] = extended_statistic
    if dimensions is not None:
        input_["dimensions"] = dimensions
    if period is not None:
        input_["period"] = period
    if unit is not None:
        input_["unit"] = unit
    if evaluation_periods is not None:
        input_["evaluation_periods"] = evaluation_periods
    if datapoints_to_alarm is not None:
        input_["datapoints_to_alarm"] = datapoints_to_alarm
    if threshold is not None:
        input_["threshold"] = threshold
    if comparison_operator is not None:
        input_["comparison_operator"] = comparison_operator
    if treat_missing_data is not None:
        input_["treat_missing_data"] = treat_missing_data
    if evaluate_low_sample_count_percentile is not None:
        input_["evaluate_low_sample_count_percentile"] = (
            evaluate_low_sample_count_percentile
        )
    if metrics is not None:
        input_["metrics"] = metrics
    if tags is not None:
        input_["tags"] = tags
    if threshold_metric_id is not None:
        input_["threshold_metric_id"] = threshold_metric_id
    if evaluation_window is not None:
        input_["evaluation_window"] = evaluation_window
    if warm_up_configuration is not None:
        input_["warm_up_configuration"] = warm_up_configuration
    if evaluation_criteria is not None:
        input_["evaluation_criteria"] = evaluation_criteria
    if evaluation_interval is not None:
        input_["evaluation_interval"] = evaluation_interval

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output