-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvariables.tf
More file actions
455 lines (383 loc) · 12.9 KB
/
variables.tf
File metadata and controls
455 lines (383 loc) · 12.9 KB
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
variable "name" {
description = "The name of the RDS instance"
default = ""
type = string
}
variable "allowed_cidr_blocks" {
description = "A list of CIDR blocks which are allowed to access the database"
type = any
default = []
}
variable "allow_major_version_upgrade" {
description = "Determines whether major engine upgrades are allowed when changing engine version"
type = bool
default = false
}
variable "allowed_security_groups" {
description = "A list of Security Group IDs to allow access to the database"
type = any
default = []
}
variable "apply_immediately" {
description = "Specifies whether any cluster modifications are applied immediately or during the next maintenance window"
type = bool
default = false
}
variable "backup_retention_period" {
description = "The number of days to retain backups for"
type = number
default = null
}
variable "create_random_password" {
description = "Whether to create a random password for the primary database cluster"
type = bool
default = true
}
variable "create_security_group" {
description = "Whether to create a security group or not"
type = bool
default = true
}
variable "database_name" {
description = "The name for an automatically created database on cluster creation"
type = string
default = ""
}
variable "deletion_protection" {
description = "Whether accidental deletion protection is enabled"
type = bool
default = true
}
variable "engine" {
description = "The name of the database engine to be used for this DB cluster"
type = string
default = "aurora"
}
variable "enable_http_endpoint" {
description = "Whether or not to enable the Data API for a serverless Aurora database engine"
type = bool
default = false
}
variable "enable_ssl_connection" {
description = "Whether or not to enable the ssl connection"
type = bool
default = false
}
variable "engine_mode" {
description = "The database engine mode. Valid values: global, parallelquery, provisioned, serverless, multimaster"
type = string
default = "provisioned"
}
variable "engine_version" {
description = "The database engine version. Updating this argument results in an outage."
type = string
default = ""
}
variable "environment" {
description = "Select enviroment type: dev, demo, prod"
type = string
default = "demo"
}
variable "family" {
description = "Version of aurora DB family being created"
type = string
default = "aurora-mysql5.7"
}
variable "final_snapshot_identifier_prefix" {
description = "The prefix name to use when creating a final snapshot on cluster destroy, appends a random 8 digits to name to ensure it's unique too."
type = string
default = "final"
}
variable "instance_type" {
description = "Instance type"
type = string
default = "db.m5.large"
}
variable "kms_key_arn" {
description = "The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage_encrypted is set to true and kms_key_id is not specified the default KMS key created in your account will be used"
type = string
default = null
}
variable "master_username" {
description = "The username for the primary cluster"
type = string
default = "root"
}
variable "master_password" {
description = "The password for the primary cluster"
type = string
default = null
}
variable "port" {
description = "The port for the database"
type = number
default = 3306
}
variable "preferred_backup_window" {
description = "The maintenance window for performing database backup"
type = string
default = ""
}
variable "preferred_maintenance_window" {
description = "The maintenance window for performing database maintenance"
type = string
default = ""
}
variable "publicly_accessible" {
description = "Specifies whether the database is publicly accessible over the internet"
type = bool
default = false
}
variable "rds_instance_name" {
description = "The name of the RDS instance"
type = 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 = {}
}
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 = "RDS Aurora SG managed by Terraform"
}
variable "skip_final_snapshot" {
description = "Determines whether a final DB snapshot is created before the DB instance is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB instance is deleted, using the value from final_snapshot_identifier"
type = bool
default = true
}
variable "storage_encrypted" {
description = "Allow Database encryption or not"
type = bool
default = true
}
variable "subnets" {
description = "List of subnet IDs used by database subnet group created"
type = list(string)
default = []
}
variable "secondary_subnets" {
description = "List of subnet IDs used by database subnet group created in secondary region"
type = list(string)
default = []
}
variable "vpc_id" {
description = "In which VPC do you want to deploy the RDS cluster"
type = string
default = ""
}
variable "autoscaling_enabled" {
description = "Whether to enable autoscaling for RDS Aurora (MySQL) read replicas"
type = bool
default = false
}
variable "autoscaling_max" {
description = "Maximum number of replicas to allow scaling for"
type = number
default = 3
}
variable "autoscaling_min" {
description = "Minimum number of replicas to allow scaling for"
type = number
default = 1
}
variable "autoscaling_cpu" {
description = "CPU usage to trigger autoscaling at"
type = number
default = 70
}
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 "snapshot_identifier" {
description = "DB snapshot to create this database from"
type = string
default = ""
}
variable "instances_config" {
description = "Map of cluster instances and any specific/overriding attributes to be created"
type = map(any)
default = {
one = {}
}
}
variable "create_monitoring_role" {
description = "Set it to true to create IAM role for Enhanced monitoring."
type = bool
default = false
}
variable "serverlessv2_scaling_configuration" {
description = "Map of nested attributes with serverless v2 scaling properties. Only valid when engine_mode is set to provisioned"
type = map(string)
default = {}
}
variable "performance_insights_retention_period" {
description = "Retention period for performance insights data, Either 7 (7 days) or 731 (2 years)."
type = number
default = null
}
variable "performance_insights_kms_key_id" {
description = "ARN of KMS key to encrypt performance insights data."
type = string
default = null
}
variable "performance_insights_enabled" {
description = "Specifies whether Performance Insights is enabled or not"
type = bool
default = null
}
variable "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 = null
}
variable "autoscaling_target_connections" {
description = "No of connections on which aurora has to scale if predefined_metric_type is RDSReaderAverageDatabaseConnections"
type = number
default = 50
}
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 "predefined_metric_type" {
description = "The metric type to scale on. Valid values are RDSReaderAverageCPUUtilization and RDSReaderAverageDatabaseConnections"
type = string
default = "RDSReaderAverageDatabaseConnections"
}
variable "long_query_time" {
description = "To prevent fast-running queries from being logged in the slow query log, specify a value for the shortest query runtime to be logged, in seconds"
type = number
default = 10
}
variable "manage_master_user_password" {
description = "Set to true to allow RDS to manage the master user password in Secrets Manager. Cannot be set if `master_password` is provided"
type = bool
default = false
}
variable "random_password_length" {
description = "The length of the randomly generated password. (default: 10)"
type = number
default = 16
}
variable "enable_egress" {
description = "Set it true if allow outbound traffic in rds security group"
type = bool
default = true
}
variable "security_group_rules" {
description = "Map of security group rules to add to the cluster security group created"
type = any
default = {}
}
variable "global_cluster_enable" {
description = "Whether enable global cluster then set it to true"
type = bool
default = false
}
variable "secondary_kms_key_arn" {
description = "The ARN for the secondary region KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. If storage_encrypted is set to true and kms_key_id is not specified the default KMS key created in your account will be used"
type = string
default = null
}
variable "secondary_vpc_id" {
description = "The secondary VPC in which secondary RDS will be launched"
type = string
default = ""
}
variable "secondary_vpc_allowed_cidr_blocks" {
description = "A list of CIDR blocks which are allowed to access the database"
type = any
default = []
}
variable "secondary_vpc_allowed_security_groups" {
description = "A list of Security Group IDs to allow access to the database"
type = any
default = []
}
variable "region" {
description = "AWS region name where the primary RDS resources will be deployed"
default = null
type = string
}
variable "secondary_region" {
description = "Secondary AWS region name where the Secondary RDS and VPC resources will be deployed"
default = null
type = string
}
variable "global_cluster_identifier" {
description = "Global RDS Cluster Identifier name"
default = null
type = string
}
variable "role_arn" {
description = "The ARN of the role to assume. Leave empty if not using assume role."
type = string
default = "" # Default to empty string if not provided
}
variable "external_id" {
description = "External ID for assuming role."
type = string
default = "" # Default to empty string if not provided
}
### backup & restore
variable "cluster_name" {
type = string
default = ""
description = "Specifies the name of the EKS cluster to deploy the MySQL application on."
}
variable "create_namespace" {
type = string
description = "Specify whether or not to create the namespace if it does not already exist. Set it to true to create the namespace."
default = false
}
variable "namespace" {
type = string
default = "db"
description = "Name of the Kubernetes namespace where the MYSQL deployment will be deployed."
}
variable "db_backup_enabled" {
type = bool
default = false
description = "Specifies whether to enable backups for MySQL database."
}
variable "db_restore_enabled" {
type = bool
default = false
description = "Specifies whether to enable restoring dump to the MySQL database."
}
variable "bucket_provider_type" {
type = string
default = "s3"
description = "Choose what type of provider you want (s3, gcs)"
}
variable "db_backup_config" {
type = map(string)
default = {
bucket_uri = ""
# s3_bucket_region = ""
cron_for_full_backup = ""
mysql_database_name = ""
# port =""
}
description = "configuration options for MySQL database backups. It includes properties such as the S3 bucket URI, the S3 bucket region, and the cron expression for full backups."
}
variable "db_restore_config" {
type = any
default = {
bucket_uri = ""
file_name = ""
# s3_bucket_region = ""
}
description = "Configuration options for restoring dump to the MySQL database."
}