generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvariables.tf
415 lines (372 loc) · 13.6 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
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
##############################################################################
# Input Variables
##############################################################################
# Common
variable "region" {
type = string
description = "The IBM Cloud region where instances will be created."
default = "us-south"
}
variable "resource_group_id" {
type = string
description = "The id of the IBM Cloud resource group where the instance(s) will be created."
default = null
}
##############################################################################
# IBM Cloud Monitoring
variable "cloud_monitoring_provision" {
description = "Provision a IBM cloud monitoring instance?"
type = bool
default = true
}
variable "cloud_monitoring_instance_name" {
type = string
description = "The name of the IBM Cloud Monitoring instance to create. Defaults to 'cloud_monitoring-<region>'"
default = null
}
variable "cloud_monitoring_plan" {
type = string
description = "The IBM Cloud Monitoring plan to provision. Available: lite, graduated-tier"
default = "lite"
validation {
condition = can(regex("^lite$|^graduated-tier$", var.cloud_monitoring_plan))
error_message = "The cloud_monitoring_plan value must be one of the following: lite, graduated-tier."
}
}
variable "cloud_monitoring_manager_key_name" {
type = string
description = "The name to give the IBM Cloud Monitoring manager key."
default = "SysdigManagerKey"
}
variable "cloud_monitoring_manager_key_tags" {
type = list(string)
description = "Tags associated with the IBM Cloud Monitoring manager key."
default = []
}
variable "cloud_monitoring_tags" {
type = list(string)
description = "Tags associated with the IBM Cloud Monitoring instance (Optional, array of strings)."
default = []
}
variable "cloud_monitoring_access_tags" {
type = list(string)
description = "A list of access tags to apply to the Cloud Monitoring instance created by the module. For more information, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial."
default = []
validation {
condition = alltrue([
for tag in var.cloud_monitoring_access_tags : can(regex("[\\w\\-_\\.]+:[\\w\\-_\\.]+", tag)) && length(tag) <= 128
])
error_message = "Tags must match the regular expression \"[\\w\\-_\\.]+:[\\w\\-_\\.]+\". For more information, see https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui#limits."
}
}
variable "enable_platform_metrics" {
type = bool
description = "Receive platform metrics in the provisioned IBM Cloud Monitoring instance."
default = true
}
variable "cloud_monitoring_service_endpoints" {
description = "The type of the service endpoint that will be set for the IBM Cloud Monitoring instance. Allowed values: public-and-private"
type = string
default = "public-and-private"
validation {
condition = contains(["public-and-private"], var.cloud_monitoring_service_endpoints)
error_message = "The specified service_endpoints is not a valid selection. Allowed values: public-and-private"
}
}
########################################################################
# Activity Tracker Event Routing
#########################################################################
# COS Targets
variable "at_cos_targets" {
type = list(object({
endpoint = string
bucket_name = string
instance_id = string
api_key = optional(string)
service_to_service_enabled = optional(bool, true)
target_region = optional(string)
target_name = string
skip_atracker_cos_iam_auth_policy = optional(bool, false)
}))
default = []
description = "List of cos target to be created"
sensitive = true
}
# Event Streams Targets
variable "at_eventstreams_targets" {
type = list(object({
instance_id = string
brokers = list(string)
topic = string
api_key = optional(string)
service_to_service_enabled = optional(bool, true)
skip_atracker_es_iam_auth_policy = optional(bool, false)
target_region = optional(string)
target_name = string
}))
default = []
description = "List of event streams target to be created"
sensitive = true
}
# Cloud Logs Targets
variable "at_cloud_logs_targets" {
type = list(object({
instance_id = string
target_region = optional(string)
target_name = string
skip_atracker_cloud_logs_iam_auth_policy = optional(bool, false)
}))
default = []
description = "List of Cloud Logs targets to be created"
}
# Routes
variable "activity_tracker_routes" {
type = list(object({
locations = list(string)
target_ids = list(string)
route_name = string
}))
default = []
description = "List of routes to be created, maximum four routes are allowed"
}
# Event Routing Setting
variable "global_event_routing_settings" {
type = object({
default_targets = optional(list(string), [])
metadata_region_primary = string
metadata_region_backup = optional(string)
permitted_target_regions = list(string)
private_api_endpoint_only = optional(bool, false)
})
description = "Global settings for event routing"
default = null
}
variable "cbr_rule_at_region" {
type = string
description = "The region where to scope the activity tracker event routing CBR rule."
default = null
}
##############################################################################
# IBM Cloud Logs
variable "cloud_logs_provision" {
description = "Provision an IBM Cloud Logs instance?"
type = bool
default = true
}
variable "cloud_logs_instance_name" {
type = string
description = "The name of the IBM Cloud Logs instance to create. Defaults to 'cloud_logs-<region>'"
default = null
}
variable "cloud_logs_plan" {
type = string
description = "The IBM Cloud Logs plan to provision. Available: standard"
default = "standard"
}
variable "cloud_logs_tags" {
type = list(string)
description = "Tags associated with the IBM Cloud Logs instance (Optional, array of strings)."
default = []
}
variable "cloud_logs_access_tags" {
type = list(string)
description = "A list of access tags to apply to the IBM Cloud Logs instance created by the module. For more information, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial."
default = []
validation {
condition = alltrue([
for tag in var.cloud_logs_access_tags : can(regex("[\\w\\-_\\.]+:[\\w\\-_\\.]+", tag)) && length(tag) <= 128
])
error_message = "Tags must match the regular expression \"[\\w\\-_\\.]+:[\\w\\-_\\.]+\". For more information, see https://cloud.ibm.com/docs/account?topic=account-tag&interface=ui#limits."
}
}
variable "cloud_logs_service_endpoints" {
description = "The type of the service endpoint that will be set for the IBM Cloud Logs instance."
type = string
default = "public-and-private"
validation {
condition = contains(["public-and-private"], var.cloud_logs_service_endpoints)
error_message = "The specified service_endpoints is not a valid selection"
}
}
variable "cloud_logs_retention_period" {
type = number
description = "The number of days IBM Cloud Logs will retain the logs data in Priority insights. Allowed values: 7, 14, 30, 60, 90."
default = 7
validation {
condition = contains([7, 14, 30, 60, 90], var.cloud_logs_retention_period)
error_message = "Valid values 'cloud_logs_retention_period' are: 7, 14, 30, 60, 90"
}
}
variable "cloud_logs_existing_en_instances" {
type = list(object({
en_instance_id = string
en_region = string
en_integration_name = optional(string)
skip_en_auth_policy = optional(bool, false)
}))
default = []
description = "List of Event Notifications instance details for routing critical events that occur in your IBM Cloud Logs."
}
variable "cloud_logs_data_storage" {
type = object({
logs_data = optional(object({
enabled = optional(bool, false)
bucket_crn = optional(string)
bucket_endpoint = optional(string)
skip_cos_auth_policy = optional(bool, false)
}), {})
metrics_data = optional(object({
enabled = optional(bool, false)
bucket_crn = optional(string)
bucket_endpoint = optional(string)
skip_cos_auth_policy = optional(bool, false)
}), {})
}
)
default = {
logs_data = null,
metrics_data = null
}
description = "A logs data bucket and a metrics bucket in IBM Cloud Object Storage to store your IBM Cloud Logs data for long term storage, search, analysis and alerting."
}
variable "skip_logs_routing_auth_policy" {
description = "Whether to create an IAM authorization policy that permits Logs Routing Sender access to the IBM Cloud Logs."
type = bool
default = false
}
variable "logs_routing_tenant_regions" {
type = list(any)
default = []
description = "Pass a list of regions to create a tenant for that is targetted to the Cloud Logs instance created by this module. To manage platform logs that are generated by IBM Cloud® services in a region of IBM Cloud, you must create a tenant in each region that you operate. Leave the list empty if you don't want to create any tenants."
nullable = false
}
########################################################################
# Cloud Logs Policies - TCO Optimizer
#########################################################################
variable "cloud_logs_policies" {
type = list(object({
logs_policy_name = string
logs_policy_description = optional(string, null)
logs_policy_priority = string
application_rule = optional(list(object({
name = string
rule_type_id = optional(string, "unspecified")
})))
subsystem_rule = optional(list(object({
name = string
rule_type_id = optional(string, "unspecified")
})))
log_rules = optional(list(object({
severities = list(string)
})))
archive_retention = optional(list(object({
id = string
})))
}))
description = "Configuration of Cloud Logs policies."
default = []
}
########################################################################
# IBM Cloud Metrics Routing
#########################################################################
variable "metrics_router_targets" {
type = list(object({
destination_crn = string
target_name = string
target_region = optional(string)
skip_mrouter_sysdig_iam_auth_policy = optional(bool, false)
}))
default = []
description = "List of Metrics Router targets to be created."
}
variable "metrics_router_routes" {
type = list(object({
name = string
rules = list(object({
action = optional(string, "send")
targets = optional(list(object({
id = string
})))
inclusion_filters = list(object({
operand = string
operator = string
values = list(string)
}))
}))
}))
default = []
description = "List of routes for IBM Metrics Router."
}
variable "metrics_router_settings" {
type = object({
default_targets = optional(list(object({
id = string
})))
permitted_target_regions = optional(list(string))
primary_metadata_region = optional(string)
backup_metadata_region = optional(string)
private_api_endpoint_only = optional(bool, false)
})
description = "Global settings for Metrics Routing."
default = null
}
##############################################################
# Context-based restriction (CBR)
##############################################################
variable "cbr_rules_at" {
type = list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
operations = optional(list(object({
api_types = list(object({
api_type_id = string
}))
})))
}))
description = "(Optional, list) List of context-based restrictions rules to create for AT event routing."
default = []
}
variable "cbr_rules_icl" {
type = list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
operations = optional(list(object({
api_types = list(object({
api_type_id = string
}))
})))
}))
description = "(Optional, list) List of context-based restrictions rules to create for IBM cloud log instance."
default = []
}
variable "cbr_rules_cloud_monitoring" {
type = list(object({
description = string
account_id = string
rule_contexts = list(object({
attributes = optional(list(object({
name = string
value = string
}))) }))
enforcement_mode = string
operations = optional(list(object({
api_types = list(object({
api_type_id = string
}))
})))
}))
description = "(Optional, list) List of context-based restrictions rules to create for IBM cloud monitoring instance."
default = []
}