aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
985 lines • 128 kB
TypeScript
import * as cdk from "../../core/lib";
import * as constructs from "constructs";
import * as cfn_parse from "../../core/lib/helpers-internal";
import { aws_autoscaling as autoScalingRefs, aws_cloudwatch as cloudWatchRefs, aws_iam as iamRefs, aws_kinesisfirehose as kinesisFirehoseRefs, aws_sns as snsRefs } from "../../interfaces";
import { AlarmMuteRuleReference, AlarmReference, AnomalyDetectorReference, CompositeAlarmReference, DashboardReference, IAlarmMuteRuleRef, IAlarmRef, IAnomalyDetectorRef, ICompositeAlarmRef, IDashboardRef, IInsightRuleRef, IMetricStreamRef, InsightRuleReference, MetricStreamReference } from "../../interfaces/generated/aws-cloudwatch-interfaces.generated";
/**
* 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.
*
* @cloudformationResource AWS::CloudWatch::Alarm
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html
*/
export declare class CfnAlarm extends cdk.CfnResource implements cdk.IInspectable, IAlarmRef, cdk.ITaggableV2 {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME: string;
/**
* Build a CfnAlarm from CloudFormation properties
*
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnAlarm;
/**
* Checks whether the given object is a CfnAlarm
*/
static isCfnAlarm(x: any): x is CfnAlarm;
/**
* Creates a new IAlarmRef from an ARN
*/
static fromAlarmArn(scope: constructs.Construct, id: string, arn: string): IAlarmRef;
/**
* Creates a new IAlarmRef from a alarmName
*/
static fromAlarmName(scope: constructs.Construct, id: string, alarmName: string): IAlarmRef;
static arnForAlarm(resource: IAlarmRef): string;
/**
* Indicates whether actions should be executed during any changes to the alarm state.
*/
private _actionsEnabled?;
/**
* The list of actions to execute when this alarm transitions into an ALARM state from any other state.
*/
private _alarmActions?;
/**
* The description of the alarm.
*/
private _alarmDescription?;
/**
* The name of the alarm.
*/
private _alarmName?;
/**
* Tag Manager which manages the tags for this resource
*/
readonly cdkTagManager: cdk.TagManager;
/**
* The arithmetic operation to use when comparing the specified statistic and threshold.
*/
private _comparisonOperator?;
/**
* The number of datapoints that must be breaching to trigger the alarm.
*/
private _datapointsToAlarm?;
/**
* The dimensions for the metric associated with the alarm.
*/
private _dimensions?;
/**
* Used only for alarms based on percentiles.
*/
private _evaluateLowSampleCountPercentile?;
private _evaluationCriteria?;
private _evaluationInterval?;
/**
* The number of periods over which data is compared to the specified threshold.
*/
private _evaluationPeriods?;
/**
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*/
private _extendedStatistic?;
/**
* The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
*/
private _insufficientDataActions?;
/**
* The name of the metric associated with the alarm.
*/
private _metricName?;
/**
* An array that enables you to create an alarm based on the result of a metric math expression.
*/
private _metrics?;
/**
* The namespace of the metric associated with the alarm.
*/
private _namespace?;
/**
* The actions to execute when this alarm transitions to the `OK` state from any other state.
*/
private _okActions?;
/**
* The period, in seconds, over which the statistic is applied.
*/
private _period?;
/**
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .
*/
private _statistic?;
/**
* A list of key-value pairs to associate with the alarm.
*/
private _tags?;
/**
* The value to compare with the specified statistic.
*/
private _threshold?;
/**
* In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
*/
private _thresholdMetricId?;
/**
* Sets how this alarm is to handle missing data points.
*/
private _treatMissingData?;
/**
* The unit of the metric associated with the alarm.
*/
private _unit?;
/**
* Create a new `AWS::CloudWatch::Alarm`.
*
* @param scope Scope in which this resource is defined
* @param id Construct identifier for this resource (unique in its scope)
* @param props Resource properties
*/
constructor(scope: constructs.Construct, id: string, props?: CfnAlarmProps);
get alarmRef(): AlarmReference;
/**
* Indicates whether actions should be executed during any changes to the alarm state.
*/
get actionsEnabled(): boolean | cdk.IResolvable | undefined;
/**
* Indicates whether actions should be executed during any changes to the alarm state.
*/
set actionsEnabled(value: boolean | cdk.IResolvable | undefined);
/**
* The list of actions to execute when this alarm transitions into an ALARM state from any other state.
*/
get alarmActions(): Array<string> | undefined;
/**
* The list of actions to execute when this alarm transitions into an ALARM state from any other state.
*/
set alarmActions(value: Array<string> | undefined);
/**
* The description of the alarm.
*/
get alarmDescription(): string | undefined;
/**
* The description of the alarm.
*/
set alarmDescription(value: string | undefined);
/**
* The name of the alarm.
*/
get alarmName(): string | undefined;
/**
* The name of the alarm.
*/
set alarmName(value: string | undefined);
/**
* The arithmetic operation to use when comparing the specified statistic and threshold.
*/
get comparisonOperator(): string | undefined;
/**
* The arithmetic operation to use when comparing the specified statistic and threshold.
*/
set comparisonOperator(value: string | undefined);
/**
* The number of datapoints that must be breaching to trigger the alarm.
*/
get datapointsToAlarm(): number | undefined;
/**
* The number of datapoints that must be breaching to trigger the alarm.
*/
set datapointsToAlarm(value: number | undefined);
/**
* The dimensions for the metric associated with the alarm.
*/
get dimensions(): Array<CfnAlarm.DimensionProperty | cdk.IResolvable> | cdk.IResolvable | undefined;
/**
* The dimensions for the metric associated with the alarm.
*/
set dimensions(value: Array<CfnAlarm.DimensionProperty | cdk.IResolvable> | cdk.IResolvable | undefined);
/**
* Used only for alarms based on percentiles.
*/
get evaluateLowSampleCountPercentile(): string | undefined;
/**
* Used only for alarms based on percentiles.
*/
set evaluateLowSampleCountPercentile(value: string | undefined);
get evaluationCriteria(): CfnAlarm.EvaluationCriteriaProperty | cdk.IResolvable | undefined;
set evaluationCriteria(value: CfnAlarm.EvaluationCriteriaProperty | cdk.IResolvable | undefined);
get evaluationInterval(): number | undefined;
set evaluationInterval(value: number | undefined);
/**
* The number of periods over which data is compared to the specified threshold.
*/
get evaluationPeriods(): number | undefined;
/**
* The number of periods over which data is compared to the specified threshold.
*/
set evaluationPeriods(value: number | undefined);
/**
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*/
get extendedStatistic(): string | undefined;
/**
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*/
set extendedStatistic(value: string | undefined);
/**
* The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
*/
get insufficientDataActions(): Array<string> | undefined;
/**
* The actions to execute when this alarm transitions to the `INSUFFICIENT_DATA` state from any other state.
*/
set insufficientDataActions(value: Array<string> | undefined);
/**
* The name of the metric associated with the alarm.
*/
get metricName(): string | undefined;
/**
* The name of the metric associated with the alarm.
*/
set metricName(value: string | undefined);
/**
* An array that enables you to create an alarm based on the result of a metric math expression.
*/
get metrics(): Array<cdk.IResolvable | CfnAlarm.MetricDataQueryProperty> | cdk.IResolvable | undefined;
/**
* An array that enables you to create an alarm based on the result of a metric math expression.
*/
set metrics(value: Array<cdk.IResolvable | CfnAlarm.MetricDataQueryProperty> | cdk.IResolvable | undefined);
/**
* The namespace of the metric associated with the alarm.
*/
get namespace(): string | undefined;
/**
* The namespace of the metric associated with the alarm.
*/
set namespace(value: string | undefined);
/**
* The actions to execute when this alarm transitions to the `OK` state from any other state.
*/
get okActions(): Array<string> | undefined;
/**
* The actions to execute when this alarm transitions to the `OK` state from any other state.
*/
set okActions(value: Array<string> | undefined);
/**
* The period, in seconds, over which the statistic is applied.
*/
get period(): number | undefined;
/**
* The period, in seconds, over which the statistic is applied.
*/
set period(value: number | undefined);
/**
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .
*/
get statistic(): string | undefined;
/**
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .
*/
set statistic(value: string | undefined);
/**
* A list of key-value pairs to associate with the alarm.
*/
get tags(): Array<cdk.CfnTag> | undefined;
/**
* A list of key-value pairs to associate with the alarm.
*/
set tags(value: Array<cdk.CfnTag> | undefined);
/**
* The value to compare with the specified statistic.
*/
get threshold(): number | undefined;
/**
* The value to compare with the specified statistic.
*/
set threshold(value: number | undefined);
/**
* In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
*/
get thresholdMetricId(): string | undefined;
/**
* In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
*/
set thresholdMetricId(value: string | undefined);
/**
* Sets how this alarm is to handle missing data points.
*/
get treatMissingData(): string | undefined;
/**
* Sets how this alarm is to handle missing data points.
*/
set treatMissingData(value: string | undefined);
/**
* The unit of the metric associated with the alarm.
*/
get unit(): string | undefined;
/**
* The unit of the metric associated with the alarm.
*/
set unit(value: string | undefined);
/**
* The ARN of the CloudWatch alarm, such as `arn:aws:cloudwatch:us-west-2:123456789012:alarm:myCloudWatchAlarm-CPUAlarm-UXMMZK36R55Z` .
*
* @cloudformationAttribute Arn
*/
get attrArn(): string;
protected get cfnProperties(): Record<string, any>;
/**
* Examines the CloudFormation resource and discloses attributes
*
* @param inspector tree inspector to collect and process attributes
*/
inspect(inspector: cdk.TreeInspector): void;
protected renderProperties(props: Record<string, any>): Record<string, any>;
}
export declare namespace CfnAlarm {
/**
* 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.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-dimension.html
*/
interface DimensionProperty {
/**
* 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
*/
readonly name: string;
/**
* 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
*/
readonly value: string;
}
/**
* 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](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) in the *Amazon CloudWatch User Guide* .
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html
*/
interface MetricDataQueryProperty {
/**
* 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
*/
readonly accountId?: string;
/**
* 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](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) 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
*/
readonly expression?: string;
/**
* 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
*/
readonly id: string;
/**
* 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
*/
readonly label?: string;
/**
* 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
*/
readonly metricStat?: cdk.IResolvable | CfnAlarm.MetricStatProperty;
/**
* 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
*/
readonly period?: number;
/**
* 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
*/
readonly returnData?: boolean | cdk.IResolvable;
}
/**
* This structure defines the metric to be returned, along with the statistics, period, and units.
*
* `MetricStat` is a property of the [MetricDataQuery](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricdataquery.html) property type.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html
*/
interface MetricStatProperty {
/**
* 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
*/
readonly metric: cdk.IResolvable | CfnAlarm.MetricProperty;
/**
* 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
*/
readonly period: number;
/**
* The statistic to return.
*
* It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in [Statistics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) 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
*/
readonly stat: string;
/**
* 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
*/
readonly unit?: string;
}
/**
* The `Metric` property type represents a specific metric.
*
* `Metric` is a property of the [MetricStat](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metricstat.html) property type.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-metric.html
*/
interface MetricProperty {
/**
* 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
*/
readonly dimensions?: Array<CfnAlarm.DimensionProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* 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
*/
readonly metricName?: string;
/**
* 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
*/
readonly namespace?: string;
}
/**
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationcriteria.html
*/
interface EvaluationCriteriaProperty {
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-evaluationcriteria.html#cfn-cloudwatch-alarm-evaluationcriteria-promqlcriteria
*/
readonly promQlCriteria?: CfnAlarm.AlarmPromQLCriteriaProperty | cdk.IResolvable;
}
/**
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html
*/
interface AlarmPromQLCriteriaProperty {
/**
* The pending period for the alarm.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-pendingperiod
*/
readonly pendingPeriod?: number;
/**
* The PromQL query string.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-query
*/
readonly query?: string;
/**
* The recovery period for the alarm.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-alarm-alarmpromqlcriteria.html#cfn-cloudwatch-alarm-alarmpromqlcriteria-recoveryperiod
*/
readonly recoveryPeriod?: number;
}
}
/**
* Properties for defining a `CfnAlarm`
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html
*/
export interface CfnAlarmProps {
/**
* Indicates whether actions should be executed during any changes to the alarm state.
*
* The default is TRUE.
*
* @default - true
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-actionsenabled
*/
readonly actionsEnabled?: boolean | cdk.IResolvable;
/**
* The list of actions to execute when this alarm transitions into an ALARM state from any other state.
*
* Specify each action as an Amazon Resource Name (ARN). For more information about creating alarms and the actions that you can specify, see [PutMetricAlarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricAlarm.html) in the *Amazon CloudWatch API Reference* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmactions
*/
readonly alarmActions?: Array<autoScalingRefs.IScalingPolicyRef | snsRefs.ITopicRef | string>;
/**
* The description of the alarm.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmdescription
*/
readonly alarmDescription?: string;
/**
* The name of the alarm.
*
* If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the alarm name.
*
* > If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-alarmname
*/
readonly alarmName?: string;
/**
* The arithmetic operation to use when comparing the specified statistic and threshold.
*
* The specified statistic value is used as the first operand.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-comparisonoperator
*/
readonly comparisonOperator?: string;
/**
* The number of datapoints 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, and the value that you set for `EvaluationPeriods` is the N value. For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide* .
*
* If you omit this parameter, CloudWatch uses the same value here that you set for `EvaluationPeriods` , and the alarm goes to alarm state if that many consecutive periods are breaching.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-datapointstoalarm
*/
readonly datapointsToAlarm?: number;
/**
* The dimensions for the metric associated with the alarm.
*
* For an alarm based on a math expression, you can't specify `Dimensions` . Instead, you use `Metrics` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-dimensions
*/
readonly dimensions?: Array<CfnAlarm.DimensionProperty | cdk.IResolvable> | cdk.IResolvable;
/**
* Used only for alarms based on percentiles.
*
* If `ignore` , the alarm state does not change during periods with too few data points to be statistically significant. If `evaluate` or this parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluatelowsamplecountpercentile
*/
readonly evaluateLowSampleCountPercentile?: string;
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluationcriteria
*/
readonly evaluationCriteria?: CfnAlarm.EvaluationCriteriaProperty | cdk.IResolvable;
/**
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluationinterval
*/
readonly evaluationInterval?: number;
/**
* 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, and `DatapointsToAlarm` is the M.
*
* For more information, see [Evaluating an Alarm](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) in the *Amazon CloudWatch User Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-evaluationperiods
*/
readonly evaluationPeriods?: number;
/**
* The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100.
*
* For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.
*
* For an alarm based on a math expression, you can't specify `ExtendedStatistic` . Instead, you use `Metrics` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-extendedstatistic
*/
readonly extendedStatistic?: string;
/**
* 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).
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-insufficientdataactions
*/
readonly insufficientDataActions?: Array<snsRefs.ITopicRef | string>;
/**
* The name of the metric associated with the alarm.
*
* This is required for an alarm based on a metric. For an alarm based on a math expression, you use `Metrics` instead and you can't specify `MetricName` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-metricname
*/
readonly metricName?: string;
/**
* An array that enables you to create an alarm based on the result of a metric math expression.
*
* Each item in the array either retrieves a metric or performs a math expression.
*
* If you specify the `Metrics` parameter, you cannot specify `MetricName` , `Dimensions` , `Period` , `Namespace` , `Statistic` , `ExtendedStatistic` , or `Unit` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-metrics
*/
readonly metrics?: Array<cdk.IResolvable | CfnAlarm.MetricDataQueryProperty> | cdk.IResolvable;
/**
* The namespace of the metric associated with the alarm.
*
* This is required for an alarm based on a metric. For an alarm based on a math expression, you can't specify `Namespace` and you use `Metrics` instead.
*
* For a list of namespaces for metrics from AWS services, see [AWS Services That Publish CloudWatch Metrics.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/aws-services-cloudwatch-metrics.html)
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-namespace
*/
readonly namespace?: string;
/**
* The actions to execute when this alarm transitions to the `OK` state from any other state.
*
* Each action is specified as an Amazon Resource Name (ARN).
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-okactions
*/
readonly okActions?: Array<snsRefs.ITopicRef | string>;
/**
* The period, in seconds, over which the statistic is applied.
*
* This is required for an alarm based on a metric. Valid values are 10, 20, 30, 60, and any multiple of 60.
*
* For an alarm based on a math expression, you can't specify `Period` , and instead you use the `Metrics` parameter.
*
* *Minimum:* 10
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-period
*/
readonly period?: number;
/**
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use `ExtendedStatistic` .
*
* For an alarm based on a metric, you must specify either `Statistic` or `ExtendedStatistic` but not both.
*
* For an alarm based on a math expression, you can't specify `Statistic` . Instead, you use `Metrics` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-statistic
*/
readonly statistic?: string;
/**
* 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.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-tags
*/
readonly tags?: Array<cdk.CfnTag>;
/**
* The value to compare with the specified statistic.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-threshold
*/
readonly threshold?: number;
/**
* In an alarm based on an anomaly detection model, this is the ID of the `ANOMALY_DETECTION_BAND` function used as the threshold for the alarm.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-thresholdmetricid
*/
readonly thresholdMetricId?: string;
/**
* Sets how this alarm is to handle missing data points.
*
* Valid values are `breaching` , `notBreaching` , `ignore` , and `missing` . For more information, see [Configuring How CloudWatch Alarms Treat Missing Data](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-missing-data) in the *Amazon CloudWatch User Guide* .
*
* If you omit this parameter, the default behavior of `missing` is used.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-treatmissingdata
*/
readonly treatMissingData?: string;
/**
* The unit of the metric associated with the alarm.
*
* Specify this only if you are creating an alarm based on a single metric. Do not specify this if you are specifying a `Metrics` array.
*
* You can specify the following values: 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-resource-cloudwatch-alarm.html#cfn-cloudwatch-alarm-unit
*/
readonly unit?: string;
}
/**
* The `AWS::CloudWatch::AnomalyDetector` type specifies an anomaly detection band for a certain metric and statistic.
*
* The band represents the expected "normal" range for the metric values. Anomaly detection bands can be used for visualization of a metric's expected values, and for alarms.
*
* For more information see [Using CloudWatch anomaly detection.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html) .
*
* @cloudformationResource AWS::CloudWatch::AnomalyDetector
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-anomalydetector.html
*/
export declare class CfnAnomalyDetector extends cdk.CfnResource implements cdk.IInspectable, IAnomalyDetectorRef {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME: string;
/**
* Build a CfnAnomalyDetector from CloudFormation properties
*
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnAnomalyDetector;
/**
* Checks whether the given object is a CfnAnomalyDetector
*/
static isCfnAnomalyDetector(x: any): x is CfnAnomalyDetector;
/**
* Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
*/
private _configuration?;
/**
* The dimensions of the metric associated with the anomaly detection band.
*/
private _dimensions?;
/**
* Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.
*/
private _metricCharacteristics?;
/**
* The CloudWatch metric math expression for this anomaly detector.
*/
private _metricMathAnomalyDetector?;
/**
* The name of the metric associated with the anomaly detection band.
*/
private _metricName?;
/**
* The namespace of the metric associated with the anomaly detection band.
*/
private _namespace?;
/**
* The CloudWatch metric and statistic for this anomaly detector.
*/
private _singleMetricAnomalyDetector?;
/**
* The statistic of the metric associated with the anomaly detection band.
*/
private _stat?;
/**
* Create a new `AWS::CloudWatch::AnomalyDetector`.
*
* @param scope Scope in which this resource is defined
* @param id Construct identifier for this resource (unique in its scope)
* @param props Resource properties
*/
constructor(scope: constructs.Construct, id: string, props?: CfnAnomalyDetectorProps);
get anomalyDetectorRef(): AnomalyDetectorReference;
/**
* Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
*/
get configuration(): CfnAnomalyDetector.ConfigurationProperty | cdk.IResolvable | undefined;
/**
* Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
*/
set configuration(value: CfnAnomalyDetector.ConfigurationProperty | cdk.IResolvable | undefined);
/**
* The dimensions of the metric associated with the anomaly detection band.
*/
get dimensions(): Array<CfnAnomalyDetector.DimensionProperty | cdk.IResolvable> | cdk.IResolvable | undefined;
/**
* The dimensions of the metric associated with the anomaly detection band.
*/
set dimensions(value: Array<CfnAnomalyDetector.DimensionProperty | cdk.IResolvable> | cdk.IResolvable | undefined);
/**
* Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.
*/
get metricCharacteristics(): cdk.IResolvable | CfnAnomalyDetector.MetricCharacteristicsProperty | undefined;
/**
* Use this object to include parameters to provide information about your metric to CloudWatch to help it build more accurate anomaly detection models.
*/
set metricCharacteristics(value: cdk.IResolvable | CfnAnomalyDetector.MetricCharacteristicsProperty | undefined);
/**
* The CloudWatch metric math expression for this anomaly detector.
*/
get metricMathAnomalyDetector(): cdk.IResolvable | CfnAnomalyDetector.MetricMathAnomalyDetectorProperty | undefined;
/**
* The CloudWatch metric math expression for this anomaly detector.
*/
set metricMathAnomalyDetector(value: cdk.IResolvable | CfnAnomalyDetector.MetricMathAnomalyDetectorProperty | undefined);
/**
* The name of the metric associated with the anomaly detection band.
*/
get metricName(): string | undefined;
/**
* The name of the metric associated with the anomaly detection band.
*/
set metricName(value: string | undefined);
/**
* The namespace of the metric associated with the anomaly detection band.
*/
get namespace(): string | undefined;
/**
* The namespace of the metric associated with the anomaly detection band.
*/
set namespace(value: string | undefined);
/**
* The CloudWatch metric and statistic for this anomaly detector.
*/
get singleMetricAnomalyDetector(): cdk.IResolvable | CfnAnomalyDetector.SingleMetricAnomalyDetectorProperty | undefined;
/**
* The CloudWatch metric and statistic for this anomaly detector.
*/
set singleMetricAnomalyDetector(value: cdk.IResolvable | CfnAnomalyDetector.SingleMetricAnomalyDetectorProperty | undefined);
/**
* The statistic of the metric associated with the anomaly detection band.
*/
get stat(): string | undefined;
/**
* The statistic of the metric associated with the anomaly detection band.
*/
set stat(value: string | undefined);
/**
* @cloudformationAttribute Id
*/
get attrId(): string;
protected get cfnProperties(): Record<string, any>;
/**
* Examines the CloudFormation resource and discloses attributes
*
* @param inspector tree inspector to collect and process attributes
*/
inspect(inspector: cdk.TreeInspector): void;
protected renderProperties(props: Record<string, any>): Record<string, any>;
}
export declare namespace CfnAnomalyDetector {
/**
* Specifies details about how the anomaly detection model is to be trained, including time ranges to exclude when training and updating the model.
*
* The configuration can also include the time zone to use for the metric.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html
*/
interface ConfigurationProperty {
/**
* Specifies an array of time ranges to exclude from use when the anomaly detection model is trained and updated.
*
* Use this to make sure that events that could cause unusual values for the metric, such as deployments, aren't used when CloudWatch creates or updates the model.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-excludedtimeranges
*/
readonly excludedTimeRanges?: Array<cdk.IResolvable | CfnAnomalyDetector.RangeProperty> | cdk.IResolvable;
/**
* The time zone to use for the metric.
*
* This is useful to enable the model to automatically account for daylight savings time changes if the metric is sensitive to such time changes.
*
* To specify a time zone, use the name of the time zone as specified in the standard tz database. For more information, see [tz database](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Tz_database) .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-configuration.html#cfn-cloudwatch-anomalydetector-configuration-metrictimezone
*/
readonly metricTimeZone?: string;
}
/**
* Each `Range` specifies one range of days or times to exclude from use for training or updating an anomaly detection model.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html
*/
interface RangeProperty {
/**
* The end time of the range to exclude.
*
* The format is `yyyy-MM-dd'T'HH:mm:ss` . For example, `2019-07-01T23:59:59` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html#cfn-cloudwatch-anomalydetector-range-endtime
*/
readonly endTime: string;
/**
* The start time of the range to exclude.
*
* The format is `yyyy-MM-dd'T'HH:mm:ss` . For example, `2019-07-01T23:59:59` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-range.html#cfn-cloudwatch-anomalydetector-range-starttime
*/
readonly startTime: string;
}
/**
* Indicates the CloudWatch math expression that provides the time series the anomaly detector uses as input.
*
* The designated math expression must return a single time series.
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html
*/
interface MetricMathAnomalyDetectorProperty {
/**
* An array of metric data query structures that enables you to create an anomaly detector based on the result of a metric math expression.
*
* Each item in `MetricDataQueries` gets a metric or performs a math expression. One item in `MetricDataQueries` is the expression that provides the time series that the anomaly detector uses as input. Designate the expression by setting `ReturnData` to `true` for this object in the array. For all other expressions and metrics, set `ReturnData` to `false` . The designated expression must return a single time series.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-anomalydetector-metricmathanomalydetector.html#cfn-clou