-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariables.tf
247 lines (207 loc) · 6.48 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
variable "zone" {
description = "The preferred compute engine zone"
default = "europe-west3-c"
type = string
}
variable "region" {
description = "GCP region"
default = "europe-west3"
type = string
}
variable "secondary_zone" {
description = "secondary GCP region preference"
default = null
type = string
}
variable "project" {
description = "GCP project name"
type = string
}
variable "namespace" {
description = "K8s namespace to where insert Cloud SQL credentials secrets"
default = "production"
type = string
}
variable "cluster_ca_certificate" {
description = "Public CA certificate that is the root of trust for the GKE K8s cluster"
default = null
type = string
}
variable "cluster_token" {
description = "Cluster master token, keep always secret!"
default = null
type = string
}
variable "cluster_endpoint" {
description = "Cluster control plane endpoint"
default = "example.com:8080"
type = string
}
variable "deletion_protection" {
description = "Whether or not to allow Terraform to destroy the instance. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail."
default = true
type = bool
}
variable "environment" {
description = "Project enviroment, e.g. stage, production and development"
default = "development"
type = string
}
variable "instance_tier" {
description = "The machine type to use"
default = "db-custom-1-3840"
type = string
}
variable "availability_type" {
description = "The availability type of the Cloud SQL instance, high availability (REGIONAL) or single zone (ZONAL)"
default = "ZONAL"
type = string
}
variable "vault_secret_path" {
description = "Path to secret in local vault, used mainly to save gke credentials"
type = string
}
variable "private_ip" {
description = "If set to true, private IP address will get allocated and connect it to VPC network set in `var.network` in the project -- once enabled, this can't be turned off."
default = false
type = bool
}
variable "sqlproxy_dependencies" {
description = "If set to true, we will create dependencies for running SQLproxy - GCP IAM SA, Kubernetes secret and Kubernetes Service"
default = true
type = bool
}
variable "public_ip" {
description = "If set to true, public IP address will get allocated"
default = false
type = bool
}
variable "network" {
description = "GCE VPC used for possible private IP addresses"
default = "default"
type = string
}
variable "authorized_networks" {
description = "List of maps of strings authorized networks allowed to connect to Cloud SQL instance, example: [{name: the_office, cidr: 1.2.3.4/31}]"
default = []
type = list(map(string))
}
variable "read_replicas" {
description = "Map of maps containing name as a key of read_replicas mapa and settings some parameters of read replica. For more information see README part Read replica"
default = {}
}
variable "db_version" {
description = "Database version"
default = "POSTGRES_11"
type = string
}
variable "database_flags" {
description = "The optional settings.database_flags list of values, where key is name and value is value from documentation: https://www.terraform.io/docs/providers/google/r/sql_database_instance.html"
default = {}
type = map(string)
}
variable "enable_query_insights" {
description = "Enable query insights https://cloud.google.com/sql/docs/postgres/insights-overview"
default = true
type = bool
}
variable "query_string_length_insights" {
description = "Insights maximum query length stored in bytes. Between 256 and 4500. Default to 1024."
default = 1024
type = number
}
variable "point_in_time_recovery" {
description = "Enable Point-in-time recovery (effectively turns on WAL)"
default = false
type = bool
}
variable "user_suffix" {
description = "Suffix - used, for instance, when you create a clone. Should include starting dash"
default = ""
type = string
}
variable "random_id_length" {
description = "Byte length of random ID, used as suffix in SQL name"
default = 4
type = number
}
variable "backup_start_time" {
description = "The time, when backup starts"
default = "03:00"
type = string
}
variable "backup_location" {
description = "Location of backups"
default = "eu"
type = string
}
variable "maintenance_window_day" {
description = "The day, when maintenance window will be performed"
default = "7"
type = string
}
variable "maintenance_window_hour" {
description = "The hour, when maintenance window begins"
default = "4"
type = string
}
variable "password_length" {
description = "Password length of postgres users"
default = 16
type = number
}
variable "password_special" {
description = "Use special characters for passwords of postgres users"
default = true
type = bool
}
variable "cloudsql_port" {
description = "CloudSQL's port"
default = 5432
type = number
}
variable "user_labels" {
description = "Labels to the instance"
type = map(string)
default = {}
}
variable "transaction_log_retention_days" {
description = "The number of days of transaction logs we retain for point in time restore, from 1-7."
type = number
default = null
}
variable "kubernetes_service_name" {
description = "Name of kubernetes service"
type = string
default = "cloudsql"
}
variable "sqlproxy_service_account_name" {
description = "SQL instance service account name"
type = string
default = null
}
variable "disk_autoresize" {
description = "Configuration to increase storage size automatically"
type = bool
default = true
}
variable "disk_autoresize_limit" {
description = "Limit of disk space for autoresize"
type = number
default = 0
}
variable "provision_kubernetes_resources" {
description = "Should we provision anything that needs Kubernetes?"
type = bool
default = true
}
variable "name_override" {
description = "Sets complete CloudSQL instance name"
type = string
default = null
}
variable "default_dbname_override" {
description = "Overrides default postgres database name"
type = string
default = null
}