generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
487 lines (419 loc) · 17.9 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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
##############################################################################
# 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."
}
variable "log_analysis_enable_archive" {
type = bool
description = "DEPRECATED: Enable archive on log analysis instances"
default = false
}
variable "activity_tracker_enable_archive" {
type = bool
description = "DEPRECATED: Enable archive on activity tracker instances"
default = false
}
variable "ibmcloud_api_key" {
type = string
description = "DEPRECATED: Restricted IBM Cloud API Key used only for writing Log Analysis archives to Cloud Object Storage"
default = null
sensitive = true
}
##############################################################################
# Log Analysis
variable "log_analysis_provision" {
description = "DEPRECATED: Provision an IBM Cloud Logging instance?"
type = bool
default = false
}
variable "log_analysis_instance_name" {
type = string
description = "DEPRECATED: The name of the IBM Cloud Logging instance to create. Defaults to 'log-analysis-<region>'"
default = null
}
variable "log_analysis_plan" {
type = string
description = "DEPRECATED: The IBM Cloud Logging plan to provision. Available: lite, 7-day, 14-day, 30-day, hipaa-30-day"
default = "lite"
validation {
condition = can(regex("^lite$|^7-day$|^14-day$|^30-day$|^hipaa-30-day$", var.log_analysis_plan))
error_message = "The log_analysis_plan value must be one of the following: lite, 7-day, 14-day, 30-day, hipaa-30-day."
}
}
variable "log_analysis_manager_key_name" {
type = string
description = "DEPRECATED: The name to give the IBM Cloud Logging manager key."
default = "LogDnaManagerKey"
}
variable "log_analysis_resource_key_role" {
type = string
description = "DEPRECATED: Role assigned to provide the IBM Cloud Logging key."
default = "Manager"
validation {
condition = contains(["Manager", "Reader", "Standard Member"], var.log_analysis_resource_key_role)
error_message = "Allowed roles can be Manager, Reader or Standard Member."
}
}
variable "log_analysis_manager_key_tags" {
type = list(string)
description = "DEPRECATED: Tags associated with the IBM Cloud Logging manager key."
default = []
}
variable "log_analysis_tags" {
type = list(string)
description = "DEPRECATED: Tags associated with the IBM Cloud Logging instance (Optional, array of strings)."
default = []
}
variable "log_analysis_access_tags" {
type = list(string)
description = "DEPRECATED: A list of access tags to apply to the Log Analysis 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.log_analysis_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 "log_analysis_service_endpoints" {
description = "DEPRECATED: The type of the service endpoint that will be set for the Log Analysis instance."
type = string
default = "public-and-private"
validation {
condition = contains(["public", "private", "public-and-private"], var.log_analysis_service_endpoints)
error_message = "The specified service_endpoints is not a valid selection"
}
}
variable "log_analysis_cos_instance_id" {
type = string
description = "DEPRECATED: The ID of the cloud object storage instance containing the Log Analysis archive bucket. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true)."
default = null
}
variable "log_analysis_cos_bucket_name" {
type = string
description = "DEPRECATED: The name of an existing COS bucket to be used for the Log Analysis archive. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true)."
default = null
}
variable "log_analysis_cos_bucket_endpoint" {
type = string
description = "DEPRECATED: An endpoint for the COS bucket for the Log Analysis archive. Pass either the public or private endpoint. (Only required when var.log_analysis_enable_archive and var.log_analysis_provision are true)."
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
variable "activity_tracker_provision" {
description = "DEPRECATED: Provision an Activity Tracker instance?"
type = bool
default = false
}
variable "activity_tracker_instance_name" {
type = string
description = "DEPRECATED: The name of the Activity Tracker instance to create. Defaults to 'activity-tracker-<region>'"
default = null
}
variable "activity_tracker_plan" {
type = string
description = "DEPRECATED: The Activity Tracker plan to provision. Available: lite, 7-day, 14-day, 30-day, hipaa-30-day"
default = "lite"
validation {
condition = can(regex("^lite$|^7-day$|^14-day$|^30-day$|^hipaa-30-day$", var.activity_tracker_plan))
error_message = "The activity_tracker_plan value must be one of the following: lite, 7-day, 14-day, 30-day, hipaa-30-day."
}
}
variable "activity_tracker_manager_key_name" {
type = string
description = "DEPRECATED: The name to give the Activity Tracker manager key."
default = "AtManagerKey"
}
variable "activity_tracker_manager_key_tags" {
type = list(string)
description = "DEPRECATED: Tags associated with the Activity Tracker manager key."
default = []
}
variable "activity_tracker_tags" {
type = list(string)
description = "DEPRECATED: Tags associated with the Activity Tracker instance (Optional, array of strings)."
default = []
}
variable "activity_tracker_access_tags" {
type = list(string)
description = "DEPRECATED: A list of access tags to apply to the Activity Tracker 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.activity_tracker_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 "activity_tracker_service_endpoints" {
description = "DEPRECATED: The type of the service endpoint that will be set for the activity tracker instance."
type = string
default = "public-and-private"
validation {
condition = contains(["public", "private", "public-and-private"], var.activity_tracker_service_endpoints)
error_message = "The specified service_endpoints is not a valid selection"
}
}
variable "at_cos_instance_id" {
type = string
description = "DEPRECATED: The ID of the cloud object storage instance containing the Activity Tracker archive bucket (Only required when var.activity_tracker_enable_archive and var.activity_tracker_provision are true)."
default = null
}
variable "at_cos_bucket_name" {
type = string
description = "DEPRECATED: The name of an existing COS bucket to be used for the Activity Tracker archive (Only required when var.activity_tracker_enable_archive and var.activity_tracker_provision are true)."
default = null
}
variable "at_cos_bucket_endpoint" {
type = string
description = "DEPRECATED: An endpoint for the COS bucket for the Activity Tracker archive. Pass either the public or private endpoint (Only required when var.activity_tracker_enable_archive and var.activity_tracker_provision are true)"
default = null
}
########################################################################
# 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 = string
target_region = optional(string)
target_name = string
}))
default = []
description = "List of event streams target to be created"
sensitive = true
}
# Log Analysis Targets
variable "at_log_analysis_targets" {
type = list(object({
instance_id = string
ingestion_key = string
target_region = optional(string)
target_name = string
}))
default = []
description = "DEPRECATED: List of log analysis 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
}
##############################################################################
# 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 "enable_platform_logs" {
type = bool
description = "Setting this to true will create a tenant in the same region that the Cloud Logs instance is provisioned to enable platform logs for that region. To send platform logs from other regions, you can explicitially specify a list of regions using the `logs_routing_tenant_regions` input. NOTE: You can only have 1 tenant per region in an account. If `log_analysis_provision` is set to true, this variable will also enable platform logs for the Log analysis instance."
default = true
}
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
}
##############################################################################