-
Notifications
You must be signed in to change notification settings - Fork 948
/
Copy pathvariables-observability.tf
240 lines (232 loc) · 7.86 KB
/
variables-observability.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/**
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "alerts" {
description = "Monitoring alerts."
type = map(object({
combiner = string
display_name = optional(string)
enabled = optional(bool)
notification_channels = optional(list(string), [])
severity = optional(string)
user_labels = optional(map(string))
alert_strategy = optional(object({
auto_close = optional(string)
notification_prompts = optional(string)
notification_rate_limit = optional(object({
period = optional(string)
}))
notification_channel_strategy = optional(object({
notification_channel_names = optional(list(string))
renotify_interval = optional(string)
}))
}))
conditions = optional(list(object({
display_name = string
condition_absent = optional(object({
duration = string
filter = optional(string)
aggregations = optional(object({
per_series_aligner = optional(string)
group_by_fields = optional(list(string))
cross_series_reducer = optional(string)
alignment_period = optional(string)
}))
trigger = optional(object({
count = optional(number)
percent = optional(number)
}))
}))
condition_matched_log = optional(object({
filter = string
label_extractors = optional(map(string))
}))
condition_monitoring_query_language = optional(object({
duration = string
query = string
evaluation_missing_data = optional(string)
trigger = optional(object({
count = optional(number)
percent = optional(number)
}))
}))
condition_prometheus_query_language = optional(object({
query = string
alert_rule = optional(string)
disable_metric_validation = optional(bool)
duration = optional(string)
evaluation_interval = optional(string)
labels = optional(map(string))
rule_group = optional(string)
}))
condition_threshold = optional(object({
comparison = string
duration = string
denominator_filter = optional(string)
evaluation_missing_data = optional(string)
filter = optional(string)
threshold_value = optional(number)
aggregations = optional(object({
per_series_aligner = optional(string)
group_by_fields = optional(list(string))
cross_series_reducer = optional(string)
alignment_period = optional(string)
}))
denominator_aggregations = optional(object({
per_series_aligner = optional(string)
group_by_fields = optional(list(string))
cross_series_reducer = optional(string)
alignment_period = optional(string)
}))
forecast_options = optional(object({
forecast_horizon = string
}))
trigger = optional(object({
count = optional(number)
percent = optional(number)
}))
}))
})), [])
documentation = optional(object({
content = optional(string)
mime_type = optional(string)
subject = optional(string)
links = optional(list(object({
display_name = optional(string)
url = optional(string)
})))
}))
}))
nullable = false
default = {}
}
variable "log_scopes" {
description = "Log scopes under this project."
type = map(object({
description = optional(string)
resource_names = list(string)
}))
nullable = false
default = {}
}
variable "logging_data_access" {
description = "Control activation of data access logs. The special 'allServices' key denotes configuration for all services."
type = map(object({
ADMIN_READ = optional(object({ exempted_members = optional(list(string)) })),
DATA_READ = optional(object({ exempted_members = optional(list(string)) })),
DATA_WRITE = optional(object({ exempted_members = optional(list(string)) }))
}))
default = {}
nullable = false
}
variable "logging_exclusions" {
description = "Logging exclusions for this project in the form {NAME -> FILTER}."
type = map(string)
default = {}
nullable = false
}
variable "logging_metrics" {
description = "Log-based metrics."
type = map(object({
filter = string
bucket_name = optional(string)
description = optional(string)
disabled = optional(bool)
label_extractors = optional(map(string))
value_extractor = optional(string)
bucket_options = optional(object({
explicit_buckets = optional(object({
bounds = list(number)
}))
exponential_buckets = optional(object({
num_finite_buckets = number
growth_factor = number
scale = number
}))
linear_buckets = optional(object({
num_finite_buckets = number
width = number
offset = number
}))
}))
metric_descriptor = optional(object({
metric_kind = string
value_type = string
display_name = optional(string)
unit = optional(string)
labels = optional(list(object({
key = string
description = optional(string)
value_type = optional(string)
})), [])
}))
}))
nullable = false
default = {}
}
variable "logging_sinks" {
description = "Logging sinks to create for this project."
type = map(object({
bq_partitioned_table = optional(bool, false)
description = optional(string)
destination = string
disabled = optional(bool, false)
exclusions = optional(map(string), {})
filter = optional(string)
iam = optional(bool, true)
type = string
unique_writer = optional(bool, true)
}))
default = {}
nullable = false
validation {
condition = alltrue([
for k, v in var.logging_sinks :
contains(["bigquery", "logging", "project", "pubsub", "storage"], v.type)
])
error_message = "Type must be one of 'bigquery', 'logging', 'project', 'pubsub', 'storage'."
}
validation {
condition = alltrue([
for k, v in var.logging_sinks :
v.bq_partitioned_table != true || v.type == "bigquery"
])
error_message = "Can only set bq_partitioned_table when type is `bigquery`."
}
}
variable "metric_scopes" {
description = "List of projects that will act as metric scopes for this project."
type = list(string)
default = []
nullable = false
}
variable "notification_channels" {
description = "Monitoring notification channels."
type = map(object({
type = string
description = optional(string)
display_name = optional(string)
enabled = optional(bool)
labels = optional(map(string))
user_labels = optional(map(string))
sensitive_labels = optional(object({
auth_token = optional(string)
password = optional(string)
service_key = optional(string)
}))
}))
nullable = false
default = {}
}