-
Notifications
You must be signed in to change notification settings - Fork 34
/
variables.tf
239 lines (201 loc) · 6.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
variable "region" {
type = string
description = "The name of the primary AWS region you wish to deploy into"
}
variable "sec_region" {
type = string
description = "The name of the secondary AWS region you wish to deploy into"
}
variable "identifier" {
description = "Cluster identifier"
type = string
default = "aurora"
}
variable "name" {
description = "Prefix for resource names"
type = string
default = "aurora"
}
variable "private_subnet_ids_p" {
type = list(string)
description = "A list of private subnet IDs in your Primary AWS region VPC"
}
variable "private_subnet_ids_s" {
type = list(string)
description = "A list of private subnet IDs in your Secondary AWS region VPC"
}
/*
variable "allowed_security_groups" {
description = "A list of Security Group ID's to allow access to."
type = list(string)
default = []
}
*/
variable "primary_instance_count" {
description = "instance count for primary Aurora cluster"
type = number
default = 2
}
variable "secondary_instance_count" {
description = "instance count for secondary Aurora cluster"
type = number
default = 1
}
variable "instance_class" {
type = string
description = "Aurora DB Instance type. Specify db.serverless to create Aurora Serverless v2 instances."
default = "db.r7g.large"
}
variable "skip_final_snapshot" {
type = bool
description = "skip creating a final snapshot before deleting the DB"
#set the value to false for production workload
default = true
}
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 "database_name" {
description = "Name for an automatically created database on cluster creation"
type = string
default = "mydb"
}
variable "username" {
description = "Master DB username"
type = string
default = "root"
}
variable "password" {
description = "Master DB password"
type = string
}
variable "manage_master_user_password" {
description = "Manage master user password using AWS Secrets Manager"
type = bool
default = false
}
variable "backup_retention_period" {
description = "How long to keep backups for (in days)"
type = number
default = 7
}
variable "preferred_backup_window" {
description = "When to perform DB backups"
type = string
default = "02:00-03:00"
}
variable "port" {
description = "The port on which to accept connections"
type = string
default = ""
}
variable "auto_minor_version_upgrade" {
description = "Determines whether minor engine upgrades will be performed automatically in the maintenance window"
type = bool
default = true
}
variable "allow_major_version_upgrade" {
description = "Enable to allow major engine version upgrades when changing engine versions. Defaults to `false`"
type = bool
default = true
}
variable "storage_encrypted" {
description = "Specifies whether the underlying Aurora storage layer should be encrypted"
type = bool
default = false
}
variable "storage_type" {
description = "Specifies Aurora storage type: Aurora Standard vs. Aurora I/O-Optimized"
type = string
default = ""
}
variable "engine" {
description = "Aurora database engine type: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora), aurora-postgresql"
type = string
default = "aurora-postgresql"
}
variable "engine_version_pg" {
description = "Aurora database engine version."
type = string
default = "15.4"
}
variable "engine_version_mysql" {
description = "Aurora database engine version."
type = string
default = "8.0.mysql_aurora.3.05.1"
}
variable "setup_globaldb" {
description = "Setup Aurora Global Database with 1 Primary and 1 X-region Secondary cluster"
type = bool
default = false
}
variable "setup_as_secondary" {
description = "Setup aws_rds_cluster.primary Terraform resource as Secondary Aurora cluster after an unplanned Aurora Global DB failover"
type = bool
default = false
}
/*
variable "replica_scale_enabled" {
description = "Whether to enable autoscaling for Aurora read replica auto scaling"
type = bool
default = false
}
*/
variable "tags" {
description = "A map of tags to add to all resources."
type = map(string)
default = {
Name = "aurora-db"
}
}
variable "monitoring_interval" {
description = "Enhanced Monitoring interval in seconds"
type = number
default = 1
validation {
condition = contains([0, 1, 5, 10, 15, 30, 60], var.monitoring_interval)
error_message = "Valid values for var: monitoring_interval are (0, 1, 5, 10, 15, 30, 60)."
}
}
variable "snapshot_identifier" {
description = "id of snapshot to restore. If you do not want to restore a db, leave the default empty string."
type = string
default = ""
}
variable "enable_audit_log" {
description = "Enable MySQL audit log export to Amazon Cloudwatch."
type = bool
default = false
}
variable "enable_error_log" {
description = "Enable MySQL error log export to Amazon Cloudwatch."
type = bool
default = false
}
variable "enable_general_log" {
description = "Enable MySQL general log export to Amazon Cloudwatch."
type = bool
default = false
}
variable "enable_slowquery_log" {
description = "Enable MySQL slowquery log export to Amazon Cloudwatch."
type = bool
default = false
}
variable "enable_postgresql_log" {
description = "Enable PostgreSQL log export to Amazon Cloudwatch."
type = bool
default = false
}
variable "serverless_v2_min_acu" {
description = "Aurora Serverless v2 Minimum ACU"
type = number
default = 0.5
}
variable "serverless_v2_max_acu" {
description = "Aurora Serverless v2 Maximum ACU"
type = number
default = 16
}