forked from clouddrove/terraform-aws-cloudwatch-alarms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
174 lines (149 loc) · 4.42 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#Module : LABEL
#Description : Terraform label module variables.
variable "name" {
type = string
default = ""
description = "Name (e.g. `app` or `cluster`)."
}
variable "repository" {
type = string
default = "https://github.com/clouddrove/terraform-aws-cloudwatch-alarms"
description = "Terraform current module repo"
validation {
# regex(...) fails if it cannot find a match
condition = can(regex("^https://", var.repository))
error_message = "The module-repo value must be a valid Git repo link."
}
}
variable "environment" {
type = string
default = ""
description = "Environment (e.g. `prod`, `dev`, `staging`)."
}
variable "label_order" {
type = list(any)
default = []
description = "Label order, e.g. `name`,`application`."
}
variable "managedby" {
type = string
default = "hello@clouddrove.com"
description = "ManagedBy, eg 'CloudDrove'."
}
#Module : CLOUDWATCH METRIC ALARM
#Description : Provides a CloudWatch Metric Alarm resource.
variable "enabled" {
type = bool
default = true
description = "Enable alarm."
}
variable "expression_enabled" {
type = bool
default = false
description = "Enable alarm with expression."
}
variable "alarm_name" {
type = string
description = "The descriptive name for the alarm."
}
variable "alarm_description" {
type = string
default = ""
description = "The description for the alarm."
}
variable "comparison_operator" {
type = string
description = "The arithmetic operation to use when comparing the specified Statistic and Threshold."
sensitive = true
}
variable "evaluation_periods" {
type = number
description = "The number of periods over which data is compared to the specified threshold."
}
variable "metric_name" {
type = string
default = "CPUUtilization"
description = "The name for the alarm's associated metric."
}
variable "namespace" {
type = string
default = "AWS/EC2"
description = "The namespace for the alarm's associated metric."
sensitive = true
}
variable "period" {
type = number
default = 120
description = "The period in seconds over which the specified statistic is applied."
}
variable "statistic" {
type = string
default = "Average"
description = "The statistic to apply to the alarm's associated metric."
}
variable "threshold" {
type = number
default = 40
description = "The value against which the specified statistic is compared."
}
variable "threshold_metric_id" {
type = string
default = ""
description = "If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function."
}
variable "alarm_actions" {
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an ALARM state from any other state."
}
variable "actions_enabled" {
type = bool
default = true
description = "Indicates whether or not actions should be executed during any changes to the alarm's state."
}
variable "insufficient_data_actions" {
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state."
}
variable "treat_missing_data" {
type = string
default = "missing"
description = "Sets how an alarm is going to handle missing data points."
}
variable "ok_actions" {
type = list(any)
default = []
description = "The list of actions to execute when this alarm transitions into an OK state from any other state."
}
variable "dimensions" {
type = map(any)
default = {}
description = "Dimensions for metrics."
}
variable "query_expressions" {
type = list(any)
default = [{
id = "e1"
expression = "ANOMALY_DETECTION_BAND(m1)"
label = "CPUUtilization (Expected)"
return_data = "true"
}]
description = "values for metric query expression."
}
variable "query_metrics" {
type = list(any)
default = [{
id = "m1"
return_data = "true"
metric_name = "CPUUtilization"
namespace = "AWS/EC2"
period = "120"
stat = "Average"
unit = "Count"
dimensions = {
InstanceId = "i-abc123"
}
}]
description = "values for metric query metrics."
}