import * as core from "@terrascript/core"; export interface MetricArgs extends core.SchemaArgs { dimensions?: core.Map | core.MapOut; metricName: string | core.StringOut; namespace?: string | core.StringOut; period: number | core.NumberOut; stat: string | core.StringOut; unit?: string | core.StringOut; } export class Metric extends core.Schema { @core.attr(String, { kind: "map" }) public dimensions?: core.Map | core.MapOut; @core.attr(String) public metricName!: string | core.StringOut; @core.attr(String) public namespace?: string | core.StringOut; @core.attr(Number) public period!: number | core.NumberOut; @core.attr(String) public stat!: string | core.StringOut; @core.attr(String) public unit?: string | core.StringOut; } export interface MetricQueryArgs extends core.SchemaArgs { accountId?: string | core.StringOut; expression?: string | core.StringOut; id: string | core.StringOut; label?: string | core.StringOut; metric?: Metric; returnData?: boolean | core.BooleanOut; } export class MetricQuery extends core.Schema { @core.attr(String) public accountId?: string | core.StringOut; @core.attr(String) public expression?: string | core.StringOut; @core.attr(String) public id!: string | core.StringOut; @core.attr(String) public label?: string | core.StringOut; @core.attr(Metric) public metric?: Metric; @core.attr(Boolean) public returnData?: boolean | core.BooleanOut; } export interface MetricAlarmArgs extends core.ResourceArgs { /** * (Optional) Indicates whether or not actions should be executed during any changes to the alarm's sta * te. Defaults to `true`. */ actionsEnabled?: boolean | core.BooleanOut; /** * (Optional) The list of actions to execute when this alarm transitions into an ALARM state from any o * ther state. Each action is specified as an Amazon Resource Name (ARN). */ alarmActions?: core.Array | core.ArrayOut; /** * (Optional) The description for the alarm. */ alarmDescription?: string | core.StringOut; /** * (Required) The descriptive name for the alarm. This name must be unique within the user's AWS accoun * t */ alarmName: string | core.StringOut; /** * (Required) The arithmetic operation to use when comparing the specified Statistic and Threshold. The * specified Statistic value is used as the first operand. Either of the following is supported: `Grea * terThanOrEqualToThreshold`, `GreaterThanThreshold`, `LessThanThreshold`, `LessThanOrEqualToThreshold * . Additionally, the values `LessThanLowerOrGreaterThanUpperThreshold`, `LessThanLowerThreshold`, a * nd `GreaterThanUpperThreshold` are used only for alarms based on anomaly detection models. */ comparisonOperator: string | core.StringOut; /** * (Optional) The number of datapoints that must be breaching to trigger the alarm. */ datapointsToAlarm?: number | core.NumberOut; /** * (Optional) The dimensions for the alarm's associated metric. For the list of available dimensions s * ee the AWS documentation [here](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW * _Support_For_AWS.html). */ dimensions?: core.Map | core.MapOut; /** * (Optional) Used only for alarms */ evaluateLowSampleCountPercentiles?: string | core.StringOut; /** * (Required) The number of periods over which data is compared to the specified threshold. */ evaluationPeriods: number | core.NumberOut; /** * (Optional) The percentile statistic for the metric associated with the alarm. Specify a value betwee * n p0.0 and p100. */ extendedStatistic?: string | core.StringOut; /** * (Optional) The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA stat * e from any other state. Each action is specified as an Amazon Resource Name (ARN). */ insufficientDataActions?: core.Array | core.ArrayOut; /** * (Optional) The name for the alarm's associated metric. */ metricName?: string | core.StringOut; metricQuery?: core.Array | core.ArrayOut; /** * (Optional) The namespace for the alarm's associated metric. See docs for the [list of namespaces](ht * tps://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/aws-namespaces.html). */ namespace?: string | core.StringOut; /** * (Optional) The list of actions to execute when this alarm transitions into an OK state from any othe * r state. Each action is specified as an Amazon Resource Name (ARN). */ okActions?: core.Array | core.ArrayOut; /** * (Optional) The period in seconds over which the specified `statistic` is applied. */ period?: number | core.NumberOut; /** * (Optional) The statistic to apply to the alarm's associated metric. */ statistic?: string | core.StringOut; /** * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev * el. */ tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ tagsAll?: core.Map | core.MapOut; /** * (Optional) The value against which the specified statistic is compared. This parameter is required f * or alarms based on static thresholds, but should not be used for alarms based on anomaly detection m * odels. */ threshold?: number | core.NumberOut; /** * (Optional) If this is an alarm based on an anomaly detection model, make this value match the ID of * the ANOMALY_DETECTION_BAND function. */ thresholdMetricId?: string | core.StringOut; /** * (Optional) Sets how this alarm is to handle missing data points. The following values are supported: * missing`, `ignore`, `breaching` and `notBreaching`. Defaults to `missing`. */ treatMissingData?: string | core.StringOut; /** * (Optional) The unit for the alarm's associated metric. */ unit?: string | core.StringOut; } export class MetricAlarm extends core.Resource { /** * (Optional) Indicates whether or not actions should be executed during any changes to the alarm's sta * te. Defaults to `true`. */ @core.attr(Boolean) public actionsEnabled?: boolean | core.BooleanOut; /** * (Optional) The list of actions to execute when this alarm transitions into an ALARM state from any o * ther state. Each action is specified as an Amazon Resource Name (ARN). */ @core.attr(String, { kind: "array" }) public alarmActions?: core.Array | core.ArrayOut; /** * (Optional) The description for the alarm. */ @core.attr(String) public alarmDescription?: string | core.StringOut; /** * (Required) The descriptive name for the alarm. This name must be unique within the user's AWS accoun * t */ @core.attr(String) public alarmName!: string | core.StringOut; /** * The ARN of the CloudWatch Metric Alarm. */ @core.attr(String, { computed: true }) public arn!: string | core.StringOut; /** * (Required) The arithmetic operation to use when comparing the specified Statistic and Threshold. The * specified Statistic value is used as the first operand. Either of the following is supported: `Grea * terThanOrEqualToThreshold`, `GreaterThanThreshold`, `LessThanThreshold`, `LessThanOrEqualToThreshold * . Additionally, the values `LessThanLowerOrGreaterThanUpperThreshold`, `LessThanLowerThreshold`, a * nd `GreaterThanUpperThreshold` are used only for alarms based on anomaly detection models. */ @core.attr(String) public comparisonOperator!: string | core.StringOut; /** * (Optional) The number of datapoints that must be breaching to trigger the alarm. */ @core.attr(Number) public datapointsToAlarm?: number | core.NumberOut; /** * (Optional) The dimensions for the alarm's associated metric. For the list of available dimensions s * ee the AWS documentation [here](http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CW * _Support_For_AWS.html). */ @core.attr(String, { kind: "map" }) public dimensions?: core.Map | core.MapOut; /** * (Optional) Used only for alarms */ @core.attr(String, { computed: true }) public evaluateLowSampleCountPercentiles?: string | core.StringOut; /** * (Required) The number of periods over which data is compared to the specified threshold. */ @core.attr(Number) public evaluationPeriods!: number | core.NumberOut; /** * (Optional) The percentile statistic for the metric associated with the alarm. Specify a value betwee * n p0.0 and p100. */ @core.attr(String) public extendedStatistic?: string | core.StringOut; /** * (Required) A short name used to tie this object to the results in the response. If you are performin * g math expressions on this set of data, this name represents that data and can serve as a variable i * n the mathematical expression. The valid characters are letters, numbers, and underscore. The first * character must be a lowercase letter. */ @core.attr(String, { computed: true }) public id!: string | core.StringOut; /** * (Optional) The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA stat * e from any other state. Each action is specified as an Amazon Resource Name (ARN). */ @core.attr(String, { kind: "array" }) public insufficientDataActions?: | core.Array | core.ArrayOut; /** * (Optional) The name for the alarm's associated metric. */ @core.attr(String) public metricName?: string | core.StringOut; @core.attr(MetricQuery, { kind: "array" }) public metricQuery?: core.Array | core.ArrayOut; /** * (Optional) The namespace for the alarm's associated metric. See docs for the [list of namespaces](ht * tps://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/aws-namespaces.html). */ @core.attr(String) public namespace?: string | core.StringOut; /** * (Optional) The list of actions to execute when this alarm transitions into an OK state from any othe * r state. Each action is specified as an Amazon Resource Name (ARN). */ @core.attr(String, { kind: "array" }) public okActions?: core.Array | core.ArrayOut; /** * (Optional) The period in seconds over which the specified `statistic` is applied. */ @core.attr(Number) public period?: number | core.NumberOut; /** * (Optional) The statistic to apply to the alarm's associated metric. */ @core.attr(String) public statistic?: string | core.StringOut; /** * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev * el. */ @core.attr(String, { kind: "map" }) public tags?: core.Map | core.MapOut; /** * A map of tags assigned to the resource, including those inherited from the provider [`default_tags` * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags- * configuration-block). */ @core.attr(String, { computed: true, kind: "map" }) public tagsAll?: core.Map | core.MapOut; /** * (Optional) The value against which the specified statistic is compared. This parameter is required f * or alarms based on static thresholds, but should not be used for alarms based on anomaly detection m * odels. */ @core.attr(Number) public threshold?: number | core.NumberOut; /** * (Optional) If this is an alarm based on an anomaly detection model, make this value match the ID of * the ANOMALY_DETECTION_BAND function. */ @core.attr(String) public thresholdMetricId?: string | core.StringOut; /** * (Optional) Sets how this alarm is to handle missing data points. The following values are supported: * missing`, `ignore`, `breaching` and `notBreaching`. Defaults to `missing`. */ @core.attr(String) public treatMissingData?: string | core.StringOut; /** * (Optional) The unit for the alarm's associated metric. */ @core.attr(String) public unit?: string | core.StringOut; constructor(name: string, args?: MetricAlarmArgs) { super(name, "aws_cloudwatch_metric_alarm", args); } public override getNamespace(): string { return "aws_cloudwatch"; } }