-
Notifications
You must be signed in to change notification settings - Fork 363
/
variables.tf
332 lines (292 loc) · 11.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
/**
* Copyright 2022 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" {
description = "The project to deploy to, if not set the default provider project is used."
type = string
}
variable "name" {
description = "Name for the forwarding rule and prefix for supporting resources"
type = string
}
variable "create_address" {
type = bool
description = "Create a new global IPv4 address"
default = true
}
variable "address" {
type = string
description = "Existing IPv4 address to use (the actual IP address value)"
default = null
}
variable "enable_ipv6" {
type = bool
description = "Enable IPv6 address on the CDN load-balancer"
default = false
}
variable "create_ipv6_address" {
type = bool
description = "Allocate a new IPv6 address. Conflicts with \"ipv6_address\" - if both specified, \"create_ipv6_address\" takes precedence."
default = false
}
variable "ipv6_address" {
type = string
description = "An existing IPv6 address to use (the actual IP address value)"
default = null
}
variable "firewall_networks" {
description = "Names of the networks to create firewall rules in"
type = list(string)
default = ["default"]
}
variable "firewall_projects" {
description = "Names of the projects to create firewall rules in"
type = list(string)
default = ["default"]
}
variable "target_tags" {
description = "List of target tags for health check firewall rule. Exactly one of target_tags or target_service_accounts should be specified."
type = list(string)
default = []
}
variable "target_service_accounts" {
description = "List of target service accounts for health check firewall rule. Exactly one of target_tags or target_service_accounts should be specified."
type = list(string)
default = []
}
variable "backends" {
description = "Map backend indices to list of backend maps."
type = map(object({
port = optional(number)
project = optional(string)
protocol = optional(string)
port_name = optional(string)
description = optional(string)
enable_cdn = optional(bool)
compression_mode = optional(string)
security_policy = optional(string, null)
edge_security_policy = optional(string, null)
custom_request_headers = optional(list(string))
custom_response_headers = optional(list(string))
timeout_sec = optional(number)
connection_draining_timeout_sec = optional(number)
session_affinity = optional(string)
affinity_cookie_ttl_sec = optional(number)
locality_lb_policy = optional(string)
health_check = optional(object({
host = optional(string)
request_path = optional(string)
request = optional(string)
response = optional(string)
port = optional(number)
port_name = optional(string)
proxy_header = optional(string)
port_specification = optional(string)
protocol = optional(string)
check_interval_sec = optional(number)
timeout_sec = optional(number)
healthy_threshold = optional(number)
unhealthy_threshold = optional(number)
logging = optional(bool)
}))
log_config = object({
enable = optional(bool)
sample_rate = optional(number)
})
groups = list(object({
group = string
description = optional(string)
balancing_mode = optional(string)
capacity_scaler = optional(number)
max_connections = optional(number)
max_connections_per_instance = optional(number)
max_connections_per_endpoint = optional(number)
max_rate = optional(number)
max_rate_per_instance = optional(number)
max_rate_per_endpoint = optional(number)
max_utilization = optional(number)
}))
iap_config = optional(object({
enable = bool
oauth2_client_id = optional(string)
oauth2_client_secret = optional(string)
}))
cdn_policy = optional(object({
cache_mode = optional(string)
signed_url_cache_max_age_sec = optional(string)
default_ttl = optional(number)
max_ttl = optional(number)
client_ttl = optional(number)
negative_caching = optional(bool)
negative_caching_policy = optional(object({
code = optional(number)
ttl = optional(number)
}))
serve_while_stale = optional(number)
cache_key_policy = optional(object({
include_host = optional(bool)
include_protocol = optional(bool)
include_query_string = optional(bool)
query_string_blacklist = optional(list(string))
query_string_whitelist = optional(list(string))
include_http_headers = optional(list(string))
include_named_cookies = optional(list(string))
}))
bypass_cache_on_request_headers = optional(list(string))
}))
outlier_detection = optional(object({
base_ejection_time = optional(object({
seconds = number
nanos = optional(number)
}))
consecutive_errors = optional(number)
consecutive_gateway_failure = optional(number)
enforcing_consecutive_errors = optional(number)
enforcing_consecutive_gateway_failure = optional(number)
enforcing_success_rate = optional(number)
interval = optional(object({
seconds = number
nanos = optional(number)
}))
max_ejection_percent = optional(number)
success_rate_minimum_hosts = optional(number)
success_rate_request_volume = optional(number)
success_rate_stdev_factor = optional(number)
}))
}))
}
variable "create_url_map" {
description = "Set to `false` if url_map variable is provided."
type = bool
default = true
}
variable "url_map" {
description = "The url_map resource to use. Default is to send all traffic to first backend."
type = string
default = null
}
variable "http_forward" {
description = "Set to `false` to disable HTTP port 80 forward"
type = bool
default = true
}
variable "ssl" {
description = "Set to `true` to enable SSL support. If `true` then at least one of these are required: 1) `ssl_certificates` OR 2) `create_ssl_certificate` set to `true` and `private_key/certificate` OR 3) `managed_ssl_certificate_domains`, OR 4) `certificate_map`"
type = bool
default = false
}
variable "create_ssl_certificate" {
description = "If `true`, Create certificate using `private_key/certificate`"
type = bool
default = false
}
variable "ssl_certificates" {
description = "SSL cert self_link list. Requires `ssl` to be set to `true`"
type = list(string)
default = []
}
variable "private_key" {
description = "Content of the private SSL key. Requires `ssl` to be set to `true` and `create_ssl_certificate` set to `true`"
type = string
default = null
}
variable "certificate" {
description = "Content of the SSL certificate. Requires `ssl` to be set to `true` and `create_ssl_certificate` set to `true`"
type = string
default = null
}
variable "managed_ssl_certificate_domains" {
description = "Create Google-managed SSL certificates for specified domains. Requires `ssl` to be set to `true`"
type = list(string)
default = []
}
variable "certificate_map" {
description = "Certificate Map ID in format projects/{project}/locations/global/certificateMaps/{name}. Identifies a certificate map associated with the given target proxy. Requires `ssl` to be set to `true`"
type = string
default = null
}
variable "ssl_policy" {
type = string
description = "Selfink to SSL Policy"
default = null
}
variable "quic" {
type = bool
description = "Specifies the QUIC override policy for this resource. Set true to enable HTTP/3 and Google QUIC support, false to disable both. Defaults to null which enables support for HTTP/3 only."
default = null
}
variable "edge_security_policy" {
description = "The resource URL for the edge security policy to associate with the backend service"
type = string
default = null
}
variable "security_policy" {
description = "The resource URL for the security policy to associate with the backend service"
type = string
default = null
}
variable "https_redirect" {
description = "Set to `true` to enable https redirect on the lb."
type = bool
default = false
}
variable "random_certificate_suffix" {
description = "Bool to enable/disable random certificate name generation. Set and keep this to true if you need to change the SSL cert."
type = bool
default = false
}
variable "labels" {
description = "The labels to attach to resources created by this module"
type = map(string)
default = {}
}
variable "load_balancing_scheme" {
description = "Load balancing scheme type (EXTERNAL for classic external load balancer, EXTERNAL_MANAGED for Envoy-based load balancer, and INTERNAL_SELF_MANAGED for traffic director)"
type = string
default = "EXTERNAL"
}
variable "network" {
description = "Network for INTERNAL_SELF_MANAGED load balancing scheme"
type = string
default = "default"
}
variable "server_tls_policy" {
description = "The resource URL for the server TLS policy to associate with the https proxy service"
type = string
default = null
}
variable "http_port" {
description = "The port for the HTTP load balancer"
type = number
default = 80
validation {
condition = var.http_port >= 1 && var.http_port <= 65535
error_message = "You must specify exactly one port between 1 and 65535"
}
}
variable "https_port" {
description = "The port for the HTTPS load balancer"
type = number
default = 443
validation {
condition = var.https_port >= 1 && var.https_port <= 65535
error_message = "You must specify exactly one port between 1 and 65535"
}
}
variable "http_keep_alive_timeout_sec" {
description = "Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds)."
type = number
default = null
}