forked from terraform-google-modules/terraform-google-sql-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables.tf
279 lines (242 loc) · 6.92 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
/**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "project_id" {
description = "The project ID to manage the Cloud SQL resources"
type = string
}
variable "name" {
type = string
description = "The name of the Cloud SQL resources"
}
variable "random_instance_name" {
type = bool
description = "Sets random suffix at the end of the Cloud SQL resource name"
default = false
}
// required
variable "database_version" {
description = "The database version to use"
type = string
}
// required
variable "region" {
description = "The region of the Cloud SQL resources"
type = string
default = "us-central1"
}
// Master
variable "tier" {
description = "The tier for the master instance."
type = string
default = "db-n1-standard-1"
}
variable "zone" {
description = "The zone for the master instance, it should be something like: `a`, `c`."
type = string
}
variable "activation_policy" {
description = "The activation policy for the master instance. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`."
type = string
default = "ALWAYS"
}
variable "availability_type" {
description = "The availability type for the master instance. Can be either `REGIONAL` or `null`."
type = string
default = "REGIONAL"
}
variable "authorized_gae_applications" {
description = "The list of authorized App Engine project names"
type = list(string)
default = []
}
variable "disk_autoresize" {
description = "Configuration to increase storage size"
type = bool
default = true
}
variable "disk_size" {
description = "The disk size for the master instance"
type = number
default = 10
}
variable "disk_type" {
description = "The disk type for the master instance."
type = string
default = "PD_SSD"
}
variable "pricing_plan" {
description = "The pricing plan for the master instance."
type = string
default = "PER_USE"
}
variable "maintenance_window_day" {
description = "The day of week (1-7) for the master instance maintenance."
type = number
default = 1
}
variable "maintenance_window_hour" {
description = "The hour of day (0-23) maintenance window for the master instance maintenance."
type = number
default = 23
}
variable "maintenance_window_update_track" {
description = "The update track of maintenance window for the master instance maintenance. Can be either `canary` or `stable`."
type = string
default = "canary"
}
variable "database_flags" {
description = "List of Cloud SQL flags that are applied to the database server"
type = list(object({
name = string
value = string
}))
default = []
}
variable "user_labels" {
type = map(string)
default = {}
description = "The key/value labels for the master instances."
}
variable "backup_configuration" {
description = "The backup_configuration settings subblock for the database setings"
type = object({
binary_log_enabled = bool
enabled = bool
start_time = string
})
default = {
binary_log_enabled = false
enabled = false
start_time = null
}
}
variable "ip_configuration" {
description = "The ip_configuration settings subblock"
type = object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
})
default = {
authorized_networks = []
ipv4_enabled = true
private_network = null
require_ssl = null
}
}
// Read Replicas
variable "read_replicas" {
description = "List of read replicas to create"
type = list(object({
name = string
tier = string
zone = string
disk_type = string
disk_autoresize = bool
disk_size = string
user_labels = map(string)
database_flags = list(object({
name = string
value = string
}))
ip_configuration = object({
authorized_networks = list(map(string))
ipv4_enabled = bool
private_network = string
require_ssl = bool
})
}))
default = []
}
variable "read_replica_name_suffix" {
description = "The optional suffix to add to the read instance name"
type = string
default = ""
}
variable "db_name" {
description = "The name of the default database to create"
type = string
default = "default"
}
variable "db_charset" {
description = "The charset for the default database"
type = string
default = ""
}
variable "db_collation" {
description = "The collation for the default database. Example: 'utf8_general_ci'"
type = string
default = ""
}
variable "additional_databases" {
description = "A list of databases to be created in your cluster"
type = list(object({
name = string
charset = string
collation = string
}))
default = []
}
variable "user_name" {
description = "The name of the default user"
type = string
default = "default"
}
variable "user_host" {
description = "The host for the default user"
type = string
default = "%"
}
variable "user_password" {
description = "The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable."
type = string
default = ""
}
variable "additional_users" {
description = "A list of users to be created in your cluster"
type = list(object({
name = string
password = string
host = string
}))
default = []
}
variable "create_timeout" {
description = "The optional timout that is applied to limit long database creates."
type = string
default = "10m"
}
variable "update_timeout" {
description = "The optional timout that is applied to limit long database updates."
type = string
default = "10m"
}
variable "delete_timeout" {
description = "The optional timout that is applied to limit long database deletes."
type = string
default = "10m"
}
variable "encryption_key_name" {
description = "The full path to the encryption key used for the CMEK disk encryption"
type = string
default = null
}
variable "module_depends_on" {
description = "List of modules or resources this module depends on."
type = list(any)
default = []
}