-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.tf
481 lines (406 loc) · 16.1 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
/* -------------------------------------------------------------------------- */
/* GENERICS */
/* -------------------------------------------------------------------------- */
variable "prefix" {
description = "The prefix name of customer to be displayed in AWS console and resource."
type = string
}
variable "name" {
description = "Name used across resources created"
type = string
}
variable "environment" {
description = "Environment name used as environment resources name."
type = string
}
variable "tags" {
description = "Tags to add more; default tags contian {terraform=true, environment=var.environment}"
type = map(string)
default = {}
}
/* -------------------------------------------------------------------------- */
/* RDS CLUSTER */
/* -------------------------------------------------------------------------- */
variable "is_create_db_subnet_group" {
description = "Determines whether to create the databae subnet group or use existing"
type = bool
default = true
}
variable "availability_zones" {
description = "(optional) describe your variable"
type = list(string)
default = null
}
variable "db_subnet_group_name" {
description = "The name of the subnet group name (existing or created)"
type = string
default = ""
}
variable "db_subnet_group_ids" {
description = "List of subnet IDs used by database subnet group created"
type = list(string)
}
variable "is_create_cluster" {
description = "Whether cluster should be created (affects nearly all resources)"
type = bool
default = true
}
variable "replication_source_identifier" {
description = "ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica"
type = string
default = null
}
variable "engine" {
description = "The name of the database engine to be used for this DB cluster. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`"
type = string
}
variable "engine_mode" {
description = "The database engine mode. Valid values: `global`, `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`"
type = string
default = "provisioned"
}
variable "engine_version" {
description = "The database engine version. Updating this argument results in an outage"
type = string
}
variable "port" {
description = "The port on which the DB accepts connections"
type = number
default = null
}
variable "is_allow_major_version_upgrade" {
description = "Enable to allow major engine version upgrades when changing engine versions. Defaults to `false`"
type = bool
default = false
}
variable "kms_key_id" {
description = "The ARN for the KMS encryption key. When specifying `kms_key_id`, `is_storage_encrypted` needs to be set to `true`"
type = string
default = null
}
variable "database_name" {
description = "Name for an automatically created database on cluster creation"
type = string
default = null
}
variable "master_username" {
description = "Username for the master DB user"
type = string
default = "root"
}
variable "is_create_random_password" {
description = "Determines whether to create random password for RDS primary cluster"
type = bool
default = true
}
variable "random_password_length" {
description = "Length of random password to create. Defaults to `10`"
type = number
default = 10
}
variable "master_password" {
description = "Password for the master DB user. Note - when specifying a value here, 'create_random_password' should be set to `false`"
type = string
default = ""
}
variable "is_skip_final_snapshot" {
description = "Determines whether a final snapshot is created before the cluster is deleted. If true is specified, no snapshot is created"
type = bool
default = false
}
variable "deletion_protection" {
description = "If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`"
type = bool
default = false
}
variable "backup_retention_period" {
description = "The days to retain backups for. Default `7`"
type = number
default = 7
}
variable "preferred_backup_window" {
description = "The daily time range during which automated backups are created if automated backups are enabled using the `backup_retention_period` parameter. Time in UTC"
type = string
default = "20:00-21:00"
}
variable "preferred_maintenance_window" {
description = "The weekly time range during which system maintenance can occur, in (UTC)"
type = string
default = "sat:22:00-sat:23:00"
}
variable "vpc_security_group_ids" {
description = "List of VPC security groups to associate to the cluster in addition to the SG we create in this module"
type = list(string)
default = []
}
variable "snapshot_identifier" {
description = "Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot"
type = string
default = null
}
variable "is_storage_encrypted" {
description = "Specifies whether the DB cluster is encrypted. The default is `true`"
type = bool
default = false
}
variable "is_apply_immediately" {
description = "Specifies whether any cluster modifications are applied immediately, or during the next maintenance window. Default is `false`"
type = bool
default = false
}
variable "db_cluster_db_instance_parameter_group_name" {
description = "Instance parameter group to associate with all instances of the DB cluster. The `db_cluster_db_instance_parameter_group_name` is only valid in combination with `is_allow_major_version_upgrade`"
type = string
default = null
}
variable "is_iam_database_authentication_enabled" {
description = "Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled"
type = bool
default = false
}
variable "is_copy_tags_to_snapshot" {
description = "Copy all Cluster `tags` to snapshots"
type = bool
default = true
}
variable "enabled_cloudwatch_logs_exports" {
description = "Set of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql`. For this module support only `postgresql`"
type = list(string)
default = []
}
variable "restore_to_point_in_time" {
description = "Map of nested attributes for cloning Aurora cluster"
type = map(string)
default = {}
}
variable "scaling_configuration" {
description = "Map of nested attributes with scaling properties. Only valid when `engine_mode` is set to `serverless`"
type = map(string)
default = {}
}
/* -------------------------------------------------------------------------- */
/* CLUSTER INSTANCE */
/* -------------------------------------------------------------------------- */
variable "instances" {
description = "Map of cluster instances and any specific/overriding attributes to be created"
type = any
default = {}
}
variable "is_instances_use_identifier_prefix" {
description = "Determines whether cluster instance identifiers are used as prefixes"
type = bool
default = false
}
variable "instance_class" {
description = "Instance type to use at master instance. Note: if `autoscaling_enabled` is `true`, this will be the same instance class used on instances created by autoscaling"
type = string
default = ""
}
variable "publicly_accessible" {
description = "Determines whether instances are publicly accessible. Default false"
type = bool
default = false
}
variable "monitoring_interval" {
description = "The interval, in seconds, between points when Enhanced Monitoring metrics are collected for instances. Set to `0` to disble. Default is `0`"
type = number
default = 0
}
variable "auto_minor_version_upgrade" {
description = "Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`"
type = bool
default = true
}
variable "performance_insights_enabled" {
description = "Specifies whether Performance Insights is enabled or not. Default `false`"
type = bool
default = false
}
variable "performance_insights_kms_key_id" {
description = "The ARN for the KMS key to encrypt Performance Insights data"
type = string
default = null
}
variable "performance_insights_retention_period" {
description = "Amount of time in days to retain Performance Insights data. Either 7 (7 days) or 731 (2 years). Default to `7`"
type = number
default = 7
}
variable "ca_cert_identifier" {
description = "The identifier of the CA certificate for the DB instance"
type = string
default = null
}
/* -------------------------------------------------------------------------- */
/* CLUSTER ENDPOINTS */
/* -------------------------------------------------------------------------- */
variable "endpoints" {
description = "Map of additional cluster endpoints and their attributes to be created"
type = any
default = {}
}
/* -------------------------------------------------------------------------- */
/* IAM ROLE ASSO */
/* -------------------------------------------------------------------------- */
variable "iam_roles" {
description = "Map of IAM roles and supported feature names to associate with the cluster"
type = map(map(string))
default = {}
}
/* -------------------------------------------------------------------------- */
/* MONITORING */
/* -------------------------------------------------------------------------- */
variable "is_create_monitoring_role" {
description = "Determines whether to create the IAM role for RDS enhanced monitoring"
type = bool
default = true
}
variable "monitoring_role_arn" {
description = "IAM role used by RDS to send enhanced monitoring metrics to CloudWatch"
type = string
default = ""
}
variable "iam_role_managed_policy_arns" {
description = "Set of exclusive IAM managed policy ARNs to attach to the monitoring role"
type = list(string)
default = null
}
variable "iam_role_permissions_boundary" {
description = "The ARN of the policy that is used to set the permissions boundary for the monitoring role"
type = string
default = null
}
variable "iam_role_force_detach_policies" {
description = "Whether to force detaching any policies the monitoring role has before destroying it"
type = bool
default = null
}
variable "iam_role_max_session_duration" {
description = "Maximum session duration (in seconds) that you want to set for the monitoring role"
type = number
default = null
}
/* -------------------------------------------------------------------------- */
/* AUTO SCALING */
/* -------------------------------------------------------------------------- */
variable "is_autoscaling_enabled" {
description = "Determines whether autoscaling of the cluster read replicas is enabled"
type = bool
default = false
}
variable "autoscaling_max_capacity" {
description = "Maximum number of read replicas permitted when autoscaling is enabled"
type = number
default = 1
}
variable "autoscaling_min_capacity" {
description = "Minimum number of read replicas permitted when autoscaling is enabled"
type = number
default = 1
}
variable "predefined_metric_type" {
description = "The metric type to scale on. Valid values are `RDSReaderAverageCPUUtilization` and `RDSReaderAverageDatabaseConnections`"
type = string
default = "RDSReaderAverageCPUUtilization"
}
variable "autoscaling_scale_in_cooldown" {
description = "Cooldown in seconds before allowing further scaling operations after a scale in"
type = number
default = 300
}
variable "autoscaling_scale_out_cooldown" {
description = "Cooldown in seconds before allowing further scaling operations after a scale out"
type = number
default = 300
}
variable "autoscaling_target_cpu" {
description = "CPU threshold which will initiate autoscaling"
type = number
default = 70
}
variable "autoscaling_target_connections" {
description = "Average number of connections threshold which will initiate autoscaling. Default value is 70% of db.r4/r5/r6g.large's default max_connections"
type = number
default = 700
}
/* -------------------------------------------------------------------------- */
/* SECURITY GROUP */
/* -------------------------------------------------------------------------- */
variable "is_create_security_group" {
description = "Determines whether to create security group for RDS cluster"
type = bool
default = true
}
variable "vpc_id" {
description = "ID of the VPC where to create security group"
type = string
}
variable "security_group_description" {
description = "The description of the security group. If value is set to empty string it will contain cluster name in the description"
type = string
default = null
}
variable "security_group_ingress_rules" {
description = "Map of ingress and any specific/overriding attributes to be created"
type = any
default = {}
}
variable "security_group_egress_rules" {
description = "A map of security group egress rule defintions to add to the security group created"
type = any
default = {}
}
/* -------------------------------------------------------------------------- */
/* PARAMETER GROUP */
/* -------------------------------------------------------------------------- */
variable "is_create_db_parameter_group" {
description = "Whether to create db parameter group or not"
type = bool
default = true
}
variable "db_parameter_group_name" {
description = "Input existed name of the DB parameter group to associate with instances"
type = string
default = null
}
variable "db_parameters" {
description = "A list of DB parameter maps to apply"
type = list(object({
apply_method = string
name = string
value = string
}))
default = []
}
variable "is_create_db_cluster_parameter_group" {
description = "Whether to create db cluster parameter group or not"
type = bool
default = true
}
variable "db_cluster_parameter_group_name" {
description = "Input existed cluster parameter group to associate with the cluster"
type = string
default = null
}
variable "db_cluster_parameters" {
description = "A list of DB parameter maps to apply"
type = list(object({
apply_method = string
name = string
value = string
}))
default = []
}
/* -------------------------------------------------------------------------- */
/* CLOUD WATCH */
/* -------------------------------------------------------------------------- */
variable "cloudwatch_log_retention_in_days" {
description = "Specifies the number of days you want to retain log events Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653, and 0. If you select 0, the events in the log group are always retained and never expire"
type = number
default = 90
}
variable "cloudwatch_log_kms_key_id" {
description = "The ARN for the KMS encryption key."
type = string
default = null
}