CfnAlarmPropsMixin

class aws_cdk.cfn_property_mixins.aws_cloudwatch.CfnAlarmPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::CloudWatch::Alarm type specifies an alarm and associates it with the specified metric or metric math expression.

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 you update an existing alarm, its state is left unchanged, but the update completely overwrites the previous configuration of the alarm.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html

CloudformationResource:

AWS::CloudWatch::Alarm

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch
import aws_cdk as cdk

# merge_strategy: cdk.IMergeStrategy
# sliding_window: Any

cfn_alarm_props_mixin = cloudwatch.CfnAlarmPropsMixin(cloudwatch.CfnAlarmMixinProps(
    actions_enabled=False,
    alarm_actions=["alarmActions"],
    alarm_description="alarmDescription",
    alarm_name="alarmName",
    comparison_operator="comparisonOperator",
    datapoints_to_alarm=123,
    dimensions=[cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
        name="name",
        value="value"
    )],
    evaluate_low_sample_count_percentile="evaluateLowSampleCountPercentile",
    evaluation_criteria=cloudwatch.CfnAlarmPropsMixin.EvaluationCriteriaProperty(
        prom_ql_criteria=cloudwatch.CfnAlarmPropsMixin.AlarmPromQLCriteriaProperty(
            pending_period=123,
            query="query",
            recovery_period=123
        )
    ),
    evaluation_interval=123,
    evaluation_periods=123,
    evaluation_window=cloudwatch.CfnAlarmPropsMixin.EvaluationWindowProperty(
        sliding_window=sliding_window,
        wall_clock_window=cloudwatch.CfnAlarmPropsMixin.WallClockWindowProperty(
            timezone="timezone"
        )
    ),
    extended_statistic="extendedStatistic",
    insufficient_data_actions=["insufficientDataActions"],
    metric_name="metricName",
    metrics=[cloudwatch.CfnAlarmPropsMixin.MetricDataQueryProperty(
        account_id="accountId",
        expression="expression",
        id="id",
        label="label",
        metric_stat=cloudwatch.CfnAlarmPropsMixin.MetricStatProperty(
            metric=cloudwatch.CfnAlarmPropsMixin.MetricProperty(
                dimensions=[cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
                    name="name",
                    value="value"
                )],
                metric_name="metricName",
                namespace="namespace"
            ),
            period=123,
            stat="stat",
            unit="unit"
        ),
        period=123,
        return_data=False
    )],
    namespace="namespace",
    ok_actions=["okActions"],
    period=123,
    statistic="statistic",
    tags=[cdk.CfnTag(
        key="key",
        value="value"
    )],
    threshold=123,
    threshold_metric_id="thresholdMetricId",
    treat_missing_data="treatMissingData",
    unit="unit",
    warm_up_configuration=cloudwatch.CfnAlarmPropsMixin.WarmUpConfigurationProperty(
        only_start_evaluating_after_warm_up_period_ends=False,
        warm_up_period_duration_in_minutes=123
    )
),
    strategy=merge_strategy
)

Create a mixin to apply properties to AWS::CloudWatch::Alarm.

Parameters:
  • props (Union[CfnAlarmMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

None

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['actionsEnabled', 'alarmActions', 'alarmDescription', 'alarmName', 'comparisonOperator', 'datapointsToAlarm', 'dimensions', 'evaluateLowSampleCountPercentile', 'evaluationCriteria', 'evaluationInterval', 'evaluationPeriods', 'evaluationWindow', 'extendedStatistic', 'insufficientDataActions', 'metricName', 'metrics', 'namespace', 'okActions', 'period', 'statistic', 'tags', 'threshold', 'thresholdMetricId', 'treatMissingData', 'unit', 'warmUpConfiguration']

Static Methods

classmethod is_mixin(x)

Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

AlarmPromQLCriteriaProperty

class CfnAlarmPropsMixin.AlarmPromQLCriteriaProperty(*, pending_period=None, query=None, recovery_period=None)

Bases: object

Contains the configuration that determines how a PromQL alarm evaluates its contributors, including the query to run and the durations that define when contributors transition between states.

Parameters:
  • pending_period (Union[int, float, None]) – The duration, in seconds, that a contributor must be continuously breaching before it transitions to the ALARM state.

  • query (Optional[str]) – 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.

  • recovery_period (Union[int, float, None]) – The duration, in seconds, that a contributor must continuously not be breaching before it transitions back to the OK state.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

alarm_prom_ql_criteria_property = cloudwatch.CfnAlarmPropsMixin.AlarmPromQLCriteriaProperty(
    pending_period=123,
    query="query",
    recovery_period=123
)

Attributes

pending_period

The duration, in seconds, that a contributor must be continuously breaching before it transitions to the ALARM state.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-pendingperiod

query

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-query

recovery_period

The duration, in seconds, that a contributor must continuously not be breaching before it transitions back to the OK state.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-recoveryperiod

DimensionProperty

class CfnAlarmPropsMixin.DimensionProperty(*, name=None, value=None)

Bases: object

Dimension is an embedded property of the AWS::CloudWatch::Alarm type.

Dimensions are name/value pairs that can be associated with a CloudWatch metric. You can specify a maximum of 30 dimensions for a given metric.

Parameters:
  • name (Optional[str]) – The name of the dimension, from 1–255 characters in length. This dimension name must have been included when the metric was published.

  • value (Optional[str]) – The value for the dimension, from 1–255 characters in length.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

dimension_property = cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the dimension, from 1–255 characters in length.

This dimension name must have been included when the metric was published.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html#cfn-cloudwatch-alarm-dimension-name

value

The value for the dimension, from 1–255 characters in length.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html#cfn-cloudwatch-alarm-dimension-value

EvaluationCriteriaProperty

class CfnAlarmPropsMixin.EvaluationCriteriaProperty(*, prom_ql_criteria=None)

Bases: object

The evaluation criteria for an alarm.

This is a union type that currently supports PromQLCriteria.

Parameters:

prom_ql_criteria (Union[IResolvable, AlarmPromQLCriteriaProperty, Dict[str, Any], None]) – Contains the configuration that determines how a PromQL alarm evaluates its contributors, including the query to run and the durations that define when contributors transition between states.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationcriteria.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

evaluation_criteria_property = cloudwatch.CfnAlarmPropsMixin.EvaluationCriteriaProperty(
    prom_ql_criteria=cloudwatch.CfnAlarmPropsMixin.AlarmPromQLCriteriaProperty(
        pending_period=123,
        query="query",
        recovery_period=123
    )
)

Attributes

prom_ql_criteria

Contains the configuration that determines how a PromQL alarm evaluates its contributors, including the query to run and the durations that define when contributors transition between states.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationcriteria.html#cfn-cloudwatch-alarm-evaluationcriteria-promqlcriteria

EvaluationWindowProperty

class CfnAlarmPropsMixin.EvaluationWindowProperty(*, sliding_window=None, wall_clock_window=None)

Bases: object

The evaluation window that an alarm uses to select the range of metric data that it evaluates each time it runs.

This is a union type. Set exactly one of its members, SlidingWindow or WallClockWindow. If you don’t set EvaluationWindow, the alarm uses a SlidingWindow by default. For more information, see Alarm evaluation windows in the CloudWatch User Guide.

Parameters:
  • sliding_window (Any) – A sliding window, which advances each time the alarm is evaluated, forming a rolling time window. This is the default evaluation window.

  • wall_clock_window (Union[IResolvable, WallClockWindowProperty, Dict[str, Any], None]) – An evaluation window that aligns the evaluated range to fixed clock boundaries that match the alarm’s period, such as the top of the hour, midnight, or the start of the calendar week, optionally in a specific time zone. When you use a wall clock window, the alarm’s period must be 1 minute (60 seconds), 5 minutes (300 seconds), 1 hour (3,600 seconds), 1 day (86,400 seconds), or 1 week (604,800 seconds). Other period values aren’t supported with a wall clock window. Choose a wall clock window when your monitoring is tied to a business or calendar period, such as daily reports, batch jobs, or backups, or when you want alarm evaluations to match the periods shown on a metric dashboard.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationwindow.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

# sliding_window: Any

evaluation_window_property = cloudwatch.CfnAlarmPropsMixin.EvaluationWindowProperty(
    sliding_window=sliding_window,
    wall_clock_window=cloudwatch.CfnAlarmPropsMixin.WallClockWindowProperty(
        timezone="timezone"
    )
)

Attributes

sliding_window

A sliding window, which advances each time the alarm is evaluated, forming a rolling time window.

This is the default evaluation window.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationwindow.html#cfn-cloudwatch-alarm-evaluationwindow-slidingwindow

wall_clock_window

An evaluation window that aligns the evaluated range to fixed clock boundaries that match the alarm’s period, such as the top of the hour, midnight, or the start of the calendar week, optionally in a specific time zone.

When you use a wall clock window, the alarm’s period must be 1 minute (60 seconds), 5 minutes (300 seconds), 1 hour (3,600 seconds), 1 day (86,400 seconds), or 1 week (604,800 seconds). Other period values aren’t supported with a wall clock window. Choose a wall clock window when your monitoring is tied to a business or calendar period, such as daily reports, batch jobs, or backups, or when you want alarm evaluations to match the periods shown on a metric dashboard.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationwindow.html#cfn-cloudwatch-alarm-evaluationwindow-wallclockwindow

MetricDataQueryProperty

class CfnAlarmPropsMixin.MetricDataQueryProperty(*, account_id=None, expression=None, id=None, label=None, metric_stat=None, period=None, return_data=None)

Bases: object

The MetricDataQuery property type specifies the metric data to return, and whether this call is just retrieving a batch set of data for one metric, or is performing a math expression on metric data.

Any expression used must return a single time series. For more information, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide .

Parameters:
  • account_id (Optional[str]) – The ID of the account where the metrics are located, if this is a cross-account alarm.

  • expression (Optional[str]) –

    The math expression to be performed on the returned data, if this object is performing a math expression. This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide . Within each MetricDataQuery object, you must specify either Expression or MetricStat but not both.

  • id (Optional[str]) – A short name used to tie this object to the results in the response. This name must be unique within a single call to GetMetricData . If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

  • label (Optional[str]) – A human-readable label for this metric or expression. This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.

  • metric_stat (Union[IResolvable, MetricStatProperty, Dict[str, Any], None]) – The metric to be returned, along with statistics, period, and units. Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data. Within one MetricDataQuery object, you must specify either Expression or MetricStat but not both.

  • period (Union[int, float, None]) – The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData operation that includes a StorageResolution of 1 second .

  • return_data (Union[bool, IResolvable, None]) – This option indicates whether to return the timestamps and raw data values of this metric. When you create an alarm based on a metric math expression, specify True for this value for only the one math expression that the alarm is based on. You must specify False for ReturnData for all the other metrics and expressions used in the alarm. This field is required.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

metric_data_query_property = cloudwatch.CfnAlarmPropsMixin.MetricDataQueryProperty(
    account_id="accountId",
    expression="expression",
    id="id",
    label="label",
    metric_stat=cloudwatch.CfnAlarmPropsMixin.MetricStatProperty(
        metric=cloudwatch.CfnAlarmPropsMixin.MetricProperty(
            dimensions=[cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
                name="name",
                value="value"
            )],
            metric_name="metricName",
            namespace="namespace"
        ),
        period=123,
        stat="stat",
        unit="unit"
    ),
    period=123,
    return_data=False
)

Attributes

account_id

The ID of the account where the metrics are located, if this is a cross-account alarm.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-accountid

expression

The math expression to be performed on the returned data, if this object is performing a math expression.

This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. For more information about metric math expressions, see Metric Math Syntax and Functions in the Amazon CloudWatch User Guide .

Within each MetricDataQuery object, you must specify either Expression or MetricStat but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-expression

id

A short name used to tie this object to the results in the response.

This name must be unique within a single call to GetMetricData . If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-id

label

A human-readable label for this metric or expression.

This is especially useful if this is an expression, so that you know what the value represents. If the metric or expression is shown in a CloudWatch dashboard widget, the label is shown. If Label is omitted, CloudWatch generates a default.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-label

metric_stat

The metric to be returned, along with statistics, period, and units.

Use this parameter only if this object is retrieving a metric and not performing a math expression on returned data.

Within one MetricDataQuery object, you must specify either Expression or MetricStat but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-metricstat

period

The granularity, in seconds, of the returned data points.

For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData operation that includes a StorageResolution of 1 second .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-period

return_data

This option indicates whether to return the timestamps and raw data values of this metric.

When you create an alarm based on a metric math expression, specify True for this value for only the one math expression that the alarm is based on. You must specify False for ReturnData for all the other metrics and expressions used in the alarm.

This field is required.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html#cfn-cloudwatch-alarm-metricdataquery-returndata

MetricProperty

class CfnAlarmPropsMixin.MetricProperty(*, dimensions=None, metric_name=None, namespace=None)

Bases: object

The Metric property type represents a specific metric.

Metric is a property of the MetricStat property type.

Parameters:
  • dimensions (Union[IResolvable, Sequence[Union[IResolvable, DimensionProperty, Dict[str, Any]]], None]) – The metric dimensions that you want to be used for the metric that the alarm will watch.

  • metric_name (Optional[str]) – The name of the metric that you want the alarm to watch. This is a required field.

  • namespace (Optional[str]) – The namespace of the metric that the alarm will watch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

metric_property = cloudwatch.CfnAlarmPropsMixin.MetricProperty(
    dimensions=[cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
        name="name",
        value="value"
    )],
    metric_name="metricName",
    namespace="namespace"
)

Attributes

dimensions

The metric dimensions that you want to be used for the metric that the alarm will watch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-dimensions

metric_name

The name of the metric that you want the alarm to watch.

This is a required field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-metricname

namespace

The namespace of the metric that the alarm will watch.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html#cfn-cloudwatch-alarm-metric-namespace

MetricStatProperty

class CfnAlarmPropsMixin.MetricStatProperty(*, metric=None, period=None, stat=None, unit=None)

Bases: object

This structure defines the metric to be returned, along with the statistics, period, and units.

MetricStat is a property of the MetricDataQuery property type.

Parameters:
  • metric (Union[IResolvable, MetricProperty, Dict[str, Any], None]) – The metric to return, including the metric name, namespace, and dimensions.

  • period (Union[int, float, None]) – The granularity, in seconds, of the returned data points. For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second. If the StartTime parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned: - Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute). - Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes). - Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).

  • stat (Optional[str]) – The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

  • unit (Optional[str]) – The unit to use for the returned data points. Valid values are: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

metric_stat_property = cloudwatch.CfnAlarmPropsMixin.MetricStatProperty(
    metric=cloudwatch.CfnAlarmPropsMixin.MetricProperty(
        dimensions=[cloudwatch.CfnAlarmPropsMixin.DimensionProperty(
            name="name",
            value="value"
        )],
        metric_name="metricName",
        namespace="namespace"
    ),
    period=123,
    stat="stat",
    unit="unit"
)

Attributes

metric

The metric to return, including the metric name, namespace, and dimensions.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-metric

period

The granularity, in seconds, of the returned data points.

For metrics with regular resolution, a period can be as short as one minute (60 seconds) and must be a multiple of 60. For high-resolution metrics that are collected at intervals of less than one minute, the period can be 1, 5, 10, 20, 30, 60, or any multiple of 60. High-resolution metrics are those metrics stored by a PutMetricData call that includes a StorageResolution of 1 second.

If the StartTime parameter specifies a time stamp that is greater than 3 hours ago, you must specify the period as follows or no data points in that time range is returned:

  • Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).

  • Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).

  • Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-period

stat

The statistic to return.

It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-stat

unit

The unit to use for the returned data points.

Valid values are: Seconds, Microseconds, Milliseconds, Bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Bits, Kilobits, Megabits, Gigabits, Terabits, Percent, Count, Bytes/Second, Kilobytes/Second, Megabytes/Second, Gigabytes/Second, Terabytes/Second, Bits/Second, Kilobits/Second, Megabits/Second, Gigabits/Second, Terabits/Second, Count/Second, or None.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html#cfn-cloudwatch-alarm-metricstat-unit

WallClockWindowProperty

class CfnAlarmPropsMixin.WallClockWindowProperty(*, timezone=None)

Bases: object

An evaluation window that aligns the evaluated range to fixed clock boundaries that match the alarm’s period, such as the top of the hour, midnight, or the start of the calendar week, optionally in a specific time zone.

When you use a wall clock window, the alarm’s period must be 1 minute (60 seconds), 5 minutes (300 seconds), 1 hour (3,600 seconds), 1 day (86,400 seconds), or 1 week (604,800 seconds). Other period values aren’t supported with a wall clock window. Choose a wall clock window when your monitoring is tied to a business or calendar period, such as daily reports, batch jobs, or backups, or when you want alarm evaluations to match the periods shown on a metric dashboard.

Parameters:

timezone (Optional[str]) – The time zone to use when the alarm aligns the evaluation window to clock boundaries. You can specify an IANA time zone name (for example, America/New_York), a fixed UTC offset (for example, +05:30), or an offset-prefixed identifier (for example, UTC+05:30). The offset must be aligned to a multiple of 5 minutes. If you don’t specify a time zone, CloudWatch uses UTC. The time zone affects window alignment for all periods, including periods of one hour or shorter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-wallclockwindow.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

wall_clock_window_property = cloudwatch.CfnAlarmPropsMixin.WallClockWindowProperty(
    timezone="timezone"
)

Attributes

timezone

The time zone to use when the alarm aligns the evaluation window to clock boundaries.

You can specify an IANA time zone name (for example, America/New_York), a fixed UTC offset (for example, +05:30), or an offset-prefixed identifier (for example, UTC+05:30). The offset must be aligned to a multiple of 5 minutes. If you don’t specify a time zone, CloudWatch uses UTC. The time zone affects window alignment for all periods, including periods of one hour or shorter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-wallclockwindow.html#cfn-cloudwatch-alarm-wallclockwindow-timezone

WarmUpConfigurationProperty

class CfnAlarmPropsMixin.WarmUpConfigurationProperty(*, only_start_evaluating_after_warm_up_period_ends=None, warm_up_period_duration_in_minutes=None)

Bases: object

Parameters:
  • only_start_evaluating_after_warm_up_period_ends (Union[bool, IResolvable, None]) – Specifies whether the alarm waits for the full warm-up period before it starts evaluating. If true, the alarm waits the entire WarmUpPeriodDurationInMinutes before it starts evaluating, even if metric data arrives earlier. If false, the alarm ends the warm-up period early and starts evaluating as soon as it has enough metric data to fill its evaluation window. This is the default behavior.

  • warm_up_period_duration_in_minutes (Union[int, float, None]) – The length of the warm-up period, in minutes. For this duration after you create or update the alarm, the alarm stays in INSUFFICIENT_DATA and doesn’t perform alarm actions. Valid values range from 1 to 2880 minutes (2 days). You can change this value while the alarm is still in its warm-up period. Changes have no effect after the warm-up period ends.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-warmupconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.cfn_property_mixins import aws_cloudwatch as cloudwatch

warm_up_configuration_property = cloudwatch.CfnAlarmPropsMixin.WarmUpConfigurationProperty(
    only_start_evaluating_after_warm_up_period_ends=False,
    warm_up_period_duration_in_minutes=123
)

Attributes

only_start_evaluating_after_warm_up_period_ends

Specifies whether the alarm waits for the full warm-up period before it starts evaluating.

If true, the alarm waits the entire WarmUpPeriodDurationInMinutes before it starts evaluating, even if metric data arrives earlier. If false, the alarm ends the warm-up period early and starts evaluating as soon as it has enough metric data to fill its evaluation window. This is the default behavior.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-warmupconfiguration.html#cfn-cloudwatch-alarm-warmupconfiguration-onlystartevaluatingafterwarmupperiodends

warm_up_period_duration_in_minutes

The length of the warm-up period, in minutes.

For this duration after you create or update the alarm, the alarm stays in INSUFFICIENT_DATA and doesn’t perform alarm actions. Valid values range from 1 to 2880 minutes (2 days). You can change this value while the alarm is still in its warm-up period. Changes have no effect after the warm-up period ends.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-warmupconfiguration.html#cfn-cloudwatch-alarm-warmupconfiguration-warmupperioddurationinminutes