-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
483 lines (407 loc) · 11.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
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
#################################################
############ common variables ############
#################################################
variable "environment" {
type = string
description = "Name of the environment, i.e. dev, stage, prod"
}
variable "namespace" {
type = string
description = "Namespace of the project, i.e. arc"
}
variable "ingress_rules" {
description = "A list of ingress rules for the security group."
type = list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
}))
default = []
}
variable "egress_rules" {
description = "A list of egress rules for the security group."
type = list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
}))
default = []
}
variable "enable_serverless" {
description = "Enable OpenSearch Serverless. If true, creates the serverless module; if false, creates the standard module."
type = bool
default = false
}
#####################################################################
#################### opensearch domain ########################
#####################################################################
variable "name" {
description = "Name of the OpenSearch domain"
type = string
}
variable "engine_version" {
description = "OpenSearch or Elasticsearch engine version"
type = string
default = "OpenSearch_1.0"
}
variable "instance_type" {
description = "Instance type for the OpenSearch domain"
type = string
default = "m5.large.search"
}
variable "instance_count" {
description = "Number of instances in the cluster"
type = number
default = 2
}
variable "zone_awareness_enabled" {
description = "Whether zone awareness is enabled"
type = bool
default = true
}
variable "dedicated_master_enabled" {
description = "Whether dedicated master is enabled"
type = bool
default = false
}
variable "dedicated_master_type" {
description = "Instance type for the dedicated master node"
type = string
default = "m5.large.search"
}
variable "dedicated_master_count" {
description = "Number of dedicated master instances"
type = number
default = 3
}
variable "use_ultrawarm" {
description = "Whether to enable UltraWarm nodes"
type = bool
default = false
}
variable "warm_type" {
description = "UltraWarm node instance type"
type = string
default = "ultrawarm1.medium.search"
}
variable "retention_in_days" {
description = "The number of days to retain log events in the log group"
type = number
default = 7
}
variable "warm_count" {
description = "Number of UltraWarm instances"
type = number
default = 2
}
variable "ebs_enabled" {
description = "Whether EBS is enabled for the domain"
type = bool
default = true
}
variable "volume_type" {
description = "EBS volume type"
type = string
default = "gp2"
}
variable "volume_size" {
description = "EBS volume size in GB"
type = number
default = 20
}
variable "iops" {
description = "Provisioned IOPS for the volume"
type = number
default = null
}
variable "throughput" {
description = "Provisioned throughput for the volume"
type = number
default = null
}
variable "vpc_id" {
description = "ID of the VPC for OpenSearch domain"
type = string
default = null
}
variable "subnet_ids" {
description = "List of subnet IDs for the OpenSearch domain"
type = list(string)
default = []
}
variable "encrypt_at_rest_enabled" {
description = "Enable encryption at rest"
type = bool
default = true
}
variable "kms_key_id" {
description = "KMS key ID for encryption at rest"
type = string
default = ""
}
variable "node_to_node_encryption_enabled" {
description = "Enable node-to-node encryption"
type = bool
default = true
}
variable "enforce_https" {
description = "Force HTTPS on the OpenSearch endpoint"
type = bool
default = true
}
variable "tls_security_policy" {
description = "TLS security policy for HTTPS endpoints"
type = string
default = "Policy-Min-TLS-1-2-PFS-2023-10"
}
variable "enable_custom_endpoint" {
description = "Enable custom domain endpoint"
type = bool
default = false
}
variable "custom_hostname" {
description = "Custom domain name for the OpenSearch endpoint"
type = string
default = ""
}
variable "custom_certificate_arn" {
description = "ARN of the ACM certificate for the custom endpoint"
type = string
default = ""
}
variable "enable_snapshot_options" {
description = "Enable snapshot options for the domain"
type = bool
default = false
}
variable "snapshot_start_hour" {
description = "Start hour for the automated snapshot"
type = number
default = 0
}
variable "log_types" {
description = "List of log types to publish to CloudWatch (Valid values: INDEX_SLOW_LOGS, SEARCH_SLOW_LOGS, ES_APPLICATION_LOGS, AUDIT_LOGS)"
type = list(string)
default = ["INDEX_SLOW_LOGS", "SEARCH_SLOW_LOGS"]
}
variable "access_policies" {
description = "Custom access policy for OpenSearch domain. If empty, default policy will be used"
type = string
default = ""
}
variable "advanced_security_enabled" {
description = "Enable advanced security options (fine-grained access control)"
type = bool
default = false
}
variable "anonymous_auth_enabled" {
description = "Enable anonymous authentication"
type = bool
default = false
}
variable "internal_user_database_enabled" {
description = "Enable internal user database for fine-grained access control"
type = bool
default = true
}
variable "master_user_name" {
description = "Master user name for OpenSearch"
type = string
default = "admin"
}
variable "enable_auto_tune" {
description = "Enable Auto-Tune for the domain"
type = bool
default = false
}
variable "auto_tune_desired_state" {
description = "Desired state of Auto-Tune"
type = string
default = "ENABLED"
}
variable "auto_tune_cron_expression" {
description = "Cron expression for Auto-Tune maintenance schedule"
type = string
default = "0 1 * * ?"
}
variable "auto_tune_duration_value" {
description = "Duration value for Auto-Tune maintenance"
type = number
default = 1
}
variable "auto_tune_duration_unit" {
description = "Duration unit for Auto-Tune maintenance"
type = string
default = "HOURS"
}
variable "auto_tune_start_at" {
description = "Start time for Auto-Tune maintenance"
type = string
default = "2024-10-23T01:00:00Z"
}
variable "enable_cognito_options" {
description = "Enable Cognito authentication for the OpenSearch domain"
type = bool
default = false
}
variable "cognito_identity_pool_id" {
description = "Cognito Identity Pool ID"
type = string
default = ""
}
variable "cognito_user_pool_id" {
description = "Cognito User Pool ID"
type = string
default = ""
}
variable "enable_off_peak_window_options" {
description = "Enable off-peak window options for the domain"
type = bool
default = false
}
variable "off_peak_hours" {
description = "Off-peak window start time (hours)"
type = number
default = 0
}
variable "off_peak_minutes" {
description = "Off-peak window start time (minutes)"
type = number
default = 0
}
variable "tags" {
description = "Tags to apply to resources"
type = map(string)
}
variable "enable_zone_awareness" {
description = "Enable zone awareness for the OpenSearch domain."
type = bool
default = false
}
variable "availability_zone_count" {
description = "The number of availability zones to use for zone awareness."
type = number
default = 2
}
variable "enable_domain_endpoint_options" {
description = "Enable custom domain endpoint options for the OpenSearch domain."
type = bool
default = false
}
variable "enable_encrypt_at_rest" {
description = "Enable encryption at rest for the OpenSearch domain."
type = bool
default = false
}
variable "log_publishing_enabled" {
description = "Whether to enable the log publishing option."
type = bool
default = true
}
variable "enable_vpc_options" {
description = "Enable VPC options for the OpenSearch domain."
type = bool
default = false
}
variable "auto_software_update_enabled" {
description = "Enable automatic software updates for OpenSearch"
type = bool
default = false
}
# SAML Options
variable "saml_options" {
description = "Configuration block for SAML options in the OpenSearch domain."
type = object({
enabled = bool
idp_entity_id = optional(string)
idp_metadata_content = optional(string)
roles_key = optional(string)
session_timeout_minutes = optional(number)
subject_key = optional(string)
})
default = {
enabled = false
idp_entity_id = null
idp_metadata_content = null
roles_key = null
session_timeout_minutes = null
subject_key = null
}
}
variable "use_iam_arn_as_master_user" {
description = "Set to true to use IAM ARN as the master user, false to create a master user."
type = bool
default = false
}
variable "master_user_arn" {
description = "The ARN of the IAM role for fine-grained access control. Required if use_iam_arn_as_master_user is true."
type = string
default = ""
}
variable "security_group_name" {
description = "Name for the security group"
type = string
default = ""
}
##################################################
######## OpenSearch Serverless Domain ###########
##################################################
variable "description" {
description = "A description for the OpenSearch collection."
type = string
default = "OpenSearch collection domain for logs and search"
}
variable "use_standby_replicas" {
description = "Flag to enable or disable standby replicas."
type = bool
default = true
}
variable "type" {
description = "The type of OpenSearch collection."
type = string
default = "TIMESERIES"
}
variable "create_encryption_policy" {
description = "Flag to determine if encryption policy should be created."
type = bool
default = true
}
variable "create_access_policy" {
description = "Flag to determine if access policy should be created."
type = bool
default = true
}
variable "access_policy_rules" {
description = "List of rules for the access policy."
type = list(object({
resource_type = string
resource = list(string)
permissions = list(string)
}))
default = []
}
variable "create_data_lifecycle_policy" {
description = "Flag to determine if data lifecycle policy should be created."
type = bool
default = true
}
variable "data_lifecycle_policy_rules" {
description = "Data lifecycle policy rules for the indices."
type = list(object({
indexes = list(string)
retention = string
}))
default = [
{
indexes = ["*"]
retention = "Unlimited"
}
]
}
variable "enable_public_access" {
description = "Enable public access for the OpenSearch collection. If false, private access will be used."
type = bool
default = false
}