generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
366 lines (314 loc) · 12.7 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
##############################################################################
# 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
}
variable "log_analysis_enable_archive" {
type = bool
description = "Enable archive on log analysis instances"
default = false
}
variable "activity_tracker_enable_archive" {
type = bool
description = "Enable archive on activity tracker instances"
default = false
}
variable "ibmcloud_api_key" {
type = string
description = "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 = "Provision an IBM Cloud Logging instance?"
type = bool
default = true
}
variable "log_analysis_instance_name" {
type = string
description = "The name of the IBM Cloud Logging instance to create. Defaults to 'log-analysis-<region>'"
default = null
}
variable "log_analysis_plan" {
type = string
description = "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 = "The name to give the IBM Cloud Logging manager key."
default = "LogDnaManagerKey"
}
variable "log_analysis_resource_key_role" {
type = string
description = "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 = "Tags associated with the IBM Cloud Logging manager key."
default = []
}
variable "log_analysis_tags" {
type = list(string)
description = "Tags associated with the IBM Cloud Logging instance (Optional, array of strings)."
default = []
}
variable "log_analysis_access_tags" {
type = list(string)
description = "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 "enable_platform_logs" {
type = bool
description = "Receive platform logs in the provisioned IBM Cloud Logging instance."
default = true
}
variable "log_analysis_service_endpoints" {
description = "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 = "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 = "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 = "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."
type = string
default = "public-and-private"
validation {
condition = contains(["public", "private", "public-and-private"], var.cloud_monitoring_service_endpoints)
error_message = "The specified service_endpoints is not a valid selection"
}
}
##############################################################################
# Activity Tracker
variable "activity_tracker_provision" {
description = "Provision an Activity Tracker instance?"
type = bool
default = true
}
variable "activity_tracker_instance_name" {
type = string
description = "The name of the Activity Tracker instance to create. Defaults to 'activity-tracker-<region>'"
default = null
}
variable "activity_tracker_plan" {
type = string
description = "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 = "The name to give the Activity Tracker manager key."
default = "AtManagerKey"
}
variable "activity_tracker_manager_key_tags" {
type = list(string)
description = "Tags associated with the Activity Tracker manager key."
default = []
}
variable "activity_tracker_tags" {
type = list(string)
description = "Tags associated with the Activity Tracker instance (Optional, array of strings)."
default = []
}
variable "activity_tracker_access_tags" {
type = list(string)
description = "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 = "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 = "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 = "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 = "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 "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 "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 "log_analysis_targets" {
type = list(object({
instance_id = string
ingestion_key = string
target_region = optional(string)
target_name = string
}))
default = []
description = "List of log analysis target to be created"
sensitive = true
}
# 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
}