diff --git a/proxy/terraform/modules/common.tf b/proxy/terraform/modules/common.tf index 3f66dc69d..9e755f9e9 100644 --- a/proxy/terraform/modules/common.tf +++ b/proxy/terraform/modules/common.tf @@ -1,4 +1,3 @@ provider "google" { - version = ">= 1.13.0" project = var.proxy_project_name } diff --git a/proxy/terraform/modules/gke.tf b/proxy/terraform/modules/gke.tf index e52b5a61b..488be79cf 100644 --- a/proxy/terraform/modules/gke.tf +++ b/proxy/terraform/modules/gke.tf @@ -17,7 +17,7 @@ module "proxy_gke_apac" { } locals { - "proxy_instance_groups" = { + proxy_instance_groups = { americas = module.proxy_gke_americas.proxy_instance_group emea = module.proxy_gke_emea.proxy_instance_group apac = module.proxy_gke_apac.proxy_instance_group diff --git a/proxy/terraform/modules/gke/cluster.tf b/proxy/terraform/modules/gke/cluster.tf index baff2132e..a33a3b26d 100644 --- a/proxy/terraform/modules/gke/cluster.tf +++ b/proxy/terraform/modules/gke/cluster.tf @@ -1,10 +1,10 @@ locals { - proxy_cluster_zone = "${lookup(var.proxy_cluster_zones, var.proxy_cluster_region)}" + proxy_cluster_zone = lookup(var.proxy_cluster_zones, var.proxy_cluster_region) } resource "google_container_cluster" "proxy_cluster" { - name = "proxy-cluster-${var.proxy_cluster_region}" - zone = local.proxy_cluster_zone + name = "proxy-cluster-${var.proxy_cluster_region}" + location = local.proxy_cluster_zone timeouts { update = "30m" diff --git a/proxy/terraform/modules/gke/output.tf b/proxy/terraform/modules/gke/output.tf index 5b874a7ce..e4f5e0dcf 100644 --- a/proxy/terraform/modules/gke/output.tf +++ b/proxy/terraform/modules/gke/output.tf @@ -1,3 +1,3 @@ output "proxy_instance_group" { - value = "${google_container_cluster.proxy_cluster.instance_group_urls[0]}" + value = google_container_cluster.proxy_cluster.instance_group_urls[0] } diff --git a/proxy/terraform/modules/gke/variables.tf b/proxy/terraform/modules/gke/variables.tf index 94b1ad014..925bbfd98 100644 --- a/proxy/terraform/modules/gke/variables.tf +++ b/proxy/terraform/modules/gke/variables.tf @@ -3,7 +3,7 @@ variable "proxy_service_account_email" {} variable "proxy_cluster_region" {} variable "proxy_cluster_zones" { - type = "map" + type = map default = { americas = "us-east4-a" diff --git a/proxy/terraform/modules/networking.tf b/proxy/terraform/modules/networking.tf index 151ba7929..23600fdb6 100644 --- a/proxy/terraform/modules/networking.tf +++ b/proxy/terraform/modules/networking.tf @@ -1,6 +1,11 @@ resource "google_dns_managed_zone" "proxy_domain" { name = "proxy-domain" dns_name = "${var.proxy_domain_name}." + + # This is a safeguard for the google provider update to 2.8.0. + # cl/264641943 + # If you like, you can remove this line after the update. + lifecycle { prevent_destroy = true } } module "proxy_networking" { diff --git a/proxy/terraform/modules/networking/loadbalancer.tf b/proxy/terraform/modules/networking/loadbalancer.tf index 17040acfb..2413be001 100644 --- a/proxy/terraform/modules/networking/loadbalancer.tf +++ b/proxy/terraform/modules/networking/loadbalancer.tf @@ -16,11 +16,11 @@ resource "google_compute_firewall" "proxy_firewall" { protocol = "tcp" ports = [ - "${var.proxy_ports["epp"]}", - "${var.proxy_ports["whois"]}", - "${var.proxy_ports["health_check"]}", - "${var.proxy_ports["http-whois"]}", - "${var.proxy_ports["https-whois"]}", + var.proxy_ports["epp"], + var.proxy_ports["whois"], + var.proxy_ports["health_check"], + var.proxy_ports["http-whois"], + var.proxy_ports["https-whois"], ] } @@ -38,7 +38,7 @@ resource "google_compute_health_check" "proxy_health_check" { name = "proxy-health-check${var.suffix}" tcp_health_check { - port = "${var.proxy_ports["health_check"]}" + port = var.proxy_ports["health_check"] request = "HEALTH_CHECK_REQUEST" response = "HEALTH_CHECK_RESPONSE" } @@ -49,7 +49,7 @@ resource "google_compute_health_check" "proxy_http_health_check" { http_health_check { host = "health-check.invalid" - port = "${var.proxy_ports["http-whois"]}" + port = var.proxy_ports["http-whois"] request_path = "/" } } @@ -66,15 +66,15 @@ resource "google_compute_backend_service" "epp_backend_service" { port_name = "epp${var.suffix}" backend { - group = "${var.proxy_instance_groups["americas"]}" + group = var.proxy_instance_groups["americas"] } backend { - group = "${var.proxy_instance_groups["emea"]}" + group = var.proxy_instance_groups["emea"] } backend { - group = "${var.proxy_instance_groups["apac"]}" + group = var.proxy_instance_groups["apac"] } health_checks = [ @@ -89,15 +89,15 @@ resource "google_compute_backend_service" "whois_backend_service" { port_name = "whois${var.suffix}" backend { - group = "${var.proxy_instance_groups["americas"]}" + group = var.proxy_instance_groups["americas"] } backend { - group = "${var.proxy_instance_groups["emea"]}" + group = var.proxy_instance_groups["emea"] } backend { - group = "${var.proxy_instance_groups["apac"]}" + group = var.proxy_instance_groups["apac"] } health_checks = [ @@ -112,15 +112,15 @@ resource "google_compute_backend_service" "https_whois_backend_service" { port_name = "https-whois${var.suffix}" backend { - group = "${var.proxy_instance_groups["americas"]}" + group = var.proxy_instance_groups["americas"] } backend { - group = "${var.proxy_instance_groups["emea"]}" + group = var.proxy_instance_groups["emea"] } backend { - group = "${var.proxy_instance_groups["apac"]}" + group = var.proxy_instance_groups["apac"] } health_checks = [ @@ -135,15 +135,15 @@ resource "google_compute_backend_service" "http_whois_backend_service" { port_name = "http-whois${var.suffix}" backend { - group = "${var.proxy_instance_groups["americas"]}" + group = var.proxy_instance_groups["americas"] } backend { - group = "${var.proxy_instance_groups["emea"]}" + group = var.proxy_instance_groups["emea"] } backend { - group = "${var.proxy_instance_groups["apac"]}" + group = var.proxy_instance_groups["apac"] } health_checks = [ diff --git a/proxy/terraform/modules/networking/variables.tf b/proxy/terraform/modules/networking/variables.tf index 72d0425a0..5ef874186 100644 --- a/proxy/terraform/modules/networking/variables.tf +++ b/proxy/terraform/modules/networking/variables.tf @@ -1,6 +1,6 @@ # Instance groups that the load balancer forwards traffic to. variable "proxy_instance_groups" { - type = "map" + type = map } # Suffix (such as "-canary") added to the resource names. @@ -10,7 +10,7 @@ variable "suffix" { # Node ports exposed by the proxy. variable "proxy_ports" { - type = "map" + type = map } # DNS zone for the proxy domain. diff --git a/proxy/terraform/modules/variables.tf b/proxy/terraform/modules/variables.tf index 758ce8ab0..e5e8db6a5 100644 --- a/proxy/terraform/modules/variables.tf +++ b/proxy/terraform/modules/variables.tf @@ -22,7 +22,7 @@ variable "proxy_key" { # Node ports exposed by the proxy. variable "proxy_ports" { - type = "map" + type = map default = { health_check = 30000 @@ -35,7 +35,7 @@ variable "proxy_ports" { # Node ports exposed by the canary proxy. variable "proxy_ports_canary" { - type = "map" + type = map default = { health_check = 31000