Skip to content

Commit 29e4503

Browse files
fix: updates for tflint (#403)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Andrew Peabody <[email protected]>
1 parent fe92b95 commit 29e4503

File tree

15 files changed

+160
-128
lines changed

15 files changed

+160
-128
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.14
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.19
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

autogen/main.tf.tmpl

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717

1818
locals {
19-
address = var.create_address ? join("", google_compute_global_address.default.*.address) : var.address
20-
ipv6_address = var.create_ipv6_address ? join("", google_compute_global_address.default_ipv6.*.address) : var.ipv6_address
19+
address = var.create_address ? join("", google_compute_global_address.default[*].address) : var.address
20+
ipv6_address = var.create_ipv6_address ? join("", google_compute_global_address.default_ipv6[*].address) : var.ipv6_address
2121

22-
url_map = var.create_url_map ? join("", google_compute_url_map.default.*.self_link) : var.url_map
22+
url_map = var.create_url_map ? join("", google_compute_url_map.default[*].self_link) : var.url_map
2323
create_http_forward = var.http_forward || var.https_redirect
2424

2525
{% if not serverless %}{# Serverless NEGs don't support health checks #}
@@ -109,7 +109,7 @@ resource "google_compute_target_http_proxy" "default" {
109109
project = var.project
110110
count = local.create_http_forward ? 1 : 0
111111
name = "${var.name}-http-proxy"
112-
url_map = var.https_redirect == false ? local.url_map : join("", google_compute_url_map.https_redirect.*.self_link)
112+
url_map = var.https_redirect == false ? local.url_map : join("", google_compute_url_map.https_redirect[*].self_link)
113113
}
114114

115115
# HTTPS proxy when ssl is true
@@ -119,7 +119,7 @@ resource "google_compute_target_https_proxy" "default" {
119119
name = "${var.name}-https-proxy"
120120
url_map = local.url_map
121121

122-
ssl_certificates = compact(concat(var.ssl_certificates, google_compute_ssl_certificate.default.*.self_link, google_compute_managed_ssl_certificate.default.*.self_link, ), )
122+
ssl_certificates = compact(concat(var.ssl_certificates, google_compute_ssl_certificate.default[*].self_link, google_compute_managed_ssl_certificate.default[*].self_link, ), )
123123
certificate_map = var.certificate_map != null ? "//certificatemanager.googleapis.com/${var.certificate_map}" : null
124124
ssl_policy = var.ssl_policy
125125
quic_override = var.quic == null ? "NONE" : var.quic ? "ENABLE" : "DISABLE"
@@ -213,27 +213,27 @@ resource "google_compute_backend_service" "default" {
213213
{% endif %}
214214

215215
# To achieve a null backend edge_security_policy, set each.value.edge_security_policy to "" (empty string), otherwise, it fallsback to var.edge_security_policy.
216-
edge_security_policy = lookup(each.value, "edge_security_policy") == "" ? null : (lookup(each.value, "edge_security_policy") == null ? var.edge_security_policy : each.value.edge_security_policy)
216+
edge_security_policy = each.value["edge_security_policy"] == "" ? null : (each.value["edge_security_policy"] == null ? var.edge_security_policy : each.value.edge_security_policy)
217217

218218
# To achieve a null backend security_policy, set each.value.security_policy to "" (empty string), otherwise, it fallsback to var.security_policy.
219-
security_policy = lookup(each.value, "security_policy") == "" ? null : (lookup(each.value, "security_policy") == null ? var.security_policy : each.value.security_policy)
219+
security_policy = each.value["security_policy"] == "" ? null : (each.value["security_policy"] == null ? var.security_policy : each.value.security_policy)
220220

221221
dynamic "backend" {
222222
for_each = toset(each.value["groups"])
223223
content {
224224
description = lookup(backend.value, "description", null)
225-
group = lookup(backend.value, "group")
225+
group = backend.value["group"]
226226

227227
{% if not serverless %}{# doesn't apply to serverless NEGs #}
228-
balancing_mode = lookup(backend.value, "balancing_mode")
229-
capacity_scaler = lookup(backend.value, "capacity_scaler")
230-
max_connections = lookup(backend.value, "max_connections")
231-
max_connections_per_instance = lookup(backend.value, "max_connections_per_instance")
232-
max_connections_per_endpoint = lookup(backend.value, "max_connections_per_endpoint")
233-
max_rate = lookup(backend.value, "max_rate")
234-
max_rate_per_instance = lookup(backend.value, "max_rate_per_instance")
235-
max_rate_per_endpoint = lookup(backend.value, "max_rate_per_endpoint")
236-
max_utilization = lookup(backend.value, "max_utilization")
228+
balancing_mode = backend.value["balancing_mode"]
229+
capacity_scaler = backend.value["capacity_scaler"]
230+
max_connections = backend.value["max_connections"]
231+
max_connections_per_instance = backend.value["max_connections_per_instance"]
232+
max_connections_per_endpoint = backend.value["max_connections_per_endpoint"]
233+
max_rate = backend.value["max_rate"]
234+
max_rate_per_instance = backend.value["max_rate_per_instance"]
235+
max_rate_per_endpoint = backend.value["max_rate_per_endpoint"]
236+
max_utilization = backend.value["max_utilization"]
237237
{% endif %}
238238
}
239239
}
@@ -296,7 +296,7 @@ resource "google_compute_backend_service" "default" {
296296
}
297297

298298
dynamic "outlier_detection" {
299-
for_each = each.value.outlier_detection != null && ( var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED" ) ? [1] : []
299+
for_each = each.value.outlier_detection != null && (var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED" ) ? [1] : []
300300
content {
301301
consecutive_errors = each.value.outlier_detection.consecutive_errors
302302
consecutive_gateway_failure = each.value.outlier_detection.consecutive_gateway_failure
@@ -358,24 +358,24 @@ resource "google_compute_health_check" "default" {
358358
dynamic "http_health_check" {
359359
for_each = coalesce(lookup(each.value["health_check"], "protocol", null), each.value["protocol"]) == "HTTP" ? [
360360
{
361-
host = lookup(each.value["health_check"], "host", null)
362-
request_path = lookup(each.value["health_check"], "request_path", null)
363-
response = lookup(each.value["health_check"], "response", null)
364-
port = lookup(each.value["health_check"], "port", null)
365-
port_name = lookup(each.value["health_check"], "port_name", null)
366-
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
367-
port_specification = lookup(each.value["health_check"], "port_specification", null)
361+
host = lookup(each.value["health_check"], "host", null)
362+
request_path = lookup(each.value["health_check"], "request_path", null)
363+
response = lookup(each.value["health_check"], "response", null)
364+
port = lookup(each.value["health_check"], "port", null)
365+
port_name = lookup(each.value["health_check"], "port_name", null)
366+
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
367+
port_specification = lookup(each.value["health_check"], "port_specification", null)
368368
}
369369
] : []
370370

371371
content {
372-
host = lookup(http_health_check.value, "host", null)
373-
request_path = lookup(http_health_check.value, "request_path", null)
374-
response = lookup(http_health_check.value, "response", null)
375-
port = lookup(http_health_check.value, "port", null)
376-
port_name = lookup(http_health_check.value, "port_name", null)
377-
proxy_header = lookup(http_health_check.value, "proxy_header", null)
378-
port_specification = lookup(http_health_check.value, "port_specification", null)
372+
host = lookup(http_health_check.value, "host", null)
373+
request_path = lookup(http_health_check.value, "request_path", null)
374+
response = lookup(http_health_check.value, "response", null)
375+
port = lookup(http_health_check.value, "port", null)
376+
port_name = lookup(http_health_check.value, "port_name", null)
377+
proxy_header = lookup(http_health_check.value, "proxy_header", null)
378+
port_specification = lookup(http_health_check.value, "port_specification", null)
379379
}
380380
}
381381

@@ -393,59 +393,59 @@ resource "google_compute_health_check" "default" {
393393
] : []
394394

395395
content {
396-
host = lookup(https_health_check.value, "host", null)
397-
request_path = lookup(https_health_check.value, "request_path", null)
398-
response = lookup(https_health_check.value, "response", null)
399-
port = lookup(https_health_check.value, "port", null)
400-
port_name = lookup(https_health_check.value, "port_name", null)
401-
proxy_header = lookup(https_health_check.value, "proxy_header", null)
402-
port_specification = lookup(https_health_check.value, "port_specification", null)
396+
host = lookup(https_health_check.value, "host", null)
397+
request_path = lookup(https_health_check.value, "request_path", null)
398+
response = lookup(https_health_check.value, "response", null)
399+
port = lookup(https_health_check.value, "port", null)
400+
port_name = lookup(https_health_check.value, "port_name", null)
401+
proxy_header = lookup(https_health_check.value, "proxy_header", null)
402+
port_specification = lookup(https_health_check.value, "port_specification", null)
403403
}
404404
}
405405

406406
dynamic "http2_health_check" {
407407
for_each = coalesce(lookup(each.value["health_check"], "protocol", null), each.value["protocol"]) == "HTTP2" ? [
408408
{
409-
host = lookup(each.value["health_check"], "host", null)
410-
request_path = lookup(each.value["health_check"], "request_path", null)
411-
response = lookup(each.value["health_check"], "response", null)
412-
port = lookup(each.value["health_check"], "port", null)
413-
port_name = lookup(each.value["health_check"], "port_name", null)
414-
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
415-
port_specification = lookup(each.value["health_check"], "port_specification", null)
409+
host = lookup(each.value["health_check"], "host", null)
410+
request_path = lookup(each.value["health_check"], "request_path", null)
411+
response = lookup(each.value["health_check"], "response", null)
412+
port = lookup(each.value["health_check"], "port", null)
413+
port_name = lookup(each.value["health_check"], "port_name", null)
414+
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
415+
port_specification = lookup(each.value["health_check"], "port_specification", null)
416416
}
417417
] : []
418418

419419
content {
420-
host = lookup(http2_health_check.value, "host", null)
421-
request_path = lookup(http2_health_check.value, "request_path", null)
422-
response = lookup(http2_health_check.value, "response", null)
423-
port = lookup(http2_health_check.value, "port", null)
424-
port_name = lookup(http2_health_check.value, "port_name", null)
425-
proxy_header = lookup(http2_health_check.value, "proxy_header", null)
426-
port_specification = lookup(http2_health_check.value, "port_specification", null)
420+
host = lookup(http2_health_check.value, "host", null)
421+
request_path = lookup(http2_health_check.value, "request_path", null)
422+
response = lookup(http2_health_check.value, "response", null)
423+
port = lookup(http2_health_check.value, "port", null)
424+
port_name = lookup(http2_health_check.value, "port_name", null)
425+
proxy_header = lookup(http2_health_check.value, "proxy_header", null)
426+
port_specification = lookup(http2_health_check.value, "port_specification", null)
427427
}
428428
}
429429

430430
dynamic "tcp_health_check" {
431431
for_each = coalesce(lookup(each.value["health_check"], "protocol", null), each.value["protocol"]) == "TCP" ? [
432432
{
433-
request = lookup(each.value["health_check"], "request", null)
434-
response = lookup(each.value["health_check"], "response", null)
435-
port = lookup(each.value["health_check"], "port", null)
436-
port_name = lookup(each.value["health_check"], "port_name", null)
437-
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
438-
port_specification = lookup(each.value["health_check"], "port_specification", null)
433+
request = lookup(each.value["health_check"], "request", null)
434+
response = lookup(each.value["health_check"], "response", null)
435+
port = lookup(each.value["health_check"], "port", null)
436+
port_name = lookup(each.value["health_check"], "port_name", null)
437+
proxy_header = lookup(each.value["health_check"], "proxy_header", null)
438+
port_specification = lookup(each.value["health_check"], "port_specification", null)
439439
}
440440
] : []
441441

442442
content {
443-
request = lookup(tcp_health_check.value, "request", null)
444-
response = lookup(tcp_health_check.value, "response", null)
445-
port = lookup(tcp_health_check.value, "port", null)
446-
port_name = lookup(tcp_health_check.value, "port_name", null)
447-
proxy_header = lookup(tcp_health_check.value, "proxy_header", null)
448-
port_specification = lookup(tcp_health_check.value, "port_specification", null)
443+
request = lookup(tcp_health_check.value, "request", null)
444+
response = lookup(tcp_health_check.value, "response", null)
445+
port = lookup(tcp_health_check.value, "port", null)
446+
port_name = lookup(tcp_health_check.value, "port_name", null)
447+
proxy_header = lookup(tcp_health_check.value, "proxy_header", null)
448+
port_specification = lookup(tcp_health_check.value, "port_specification", null)
449449
}
450450
}
451451
}

autogen/outputs.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,5 @@ output "url_map" {
5252

5353
output "ssl_certificate_created" {
5454
description = "The SSL certificate create from key/pem"
55-
value = google_compute_ssl_certificate.default.*.self_link
55+
value = google_compute_ssl_certificate.default[*].self_link
5656
}

build/int.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ tags:
9393
- 'integration'
9494
substitutions:
9595
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
96-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.14'
96+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.19'

build/lint.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ tags:
2121
- 'lint'
2222
substitutions:
2323
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
24-
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.14'
24+
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.19'

examples/multiple-certs/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ module "gce-lb-https" {
134134
url_map = google_compute_url_map.https-multi-cert.self_link
135135
create_url_map = false
136136
ssl = true
137-
ssl_certificates = google_compute_ssl_certificate.example.*.self_link
137+
ssl_certificates = google_compute_ssl_certificate.example[*].self_link
138138

139139
backends = {
140140
default = {

examples/user-managed-google-managed-ssl/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module "gce-lb-https" {
7777
private_key = tls_private_key.single_key.private_key_pem
7878
certificate = tls_self_signed_cert.single_cert.cert_pem
7979
managed_ssl_certificate_domains = ["test.example.com"]
80-
ssl_certificates = google_compute_ssl_certificate.example.*.self_link
80+
ssl_certificates = google_compute_ssl_certificate.example[*].self_link
8181

8282
backends = {
8383
default = {

0 commit comments

Comments
 (0)