From 02846bcbdda0ec66a0fcdc9ccddf88b1e050f022 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Fri, 22 Nov 2019 16:08:56 -0500 Subject: [PATCH] No-op: Use nicer HCL2 syntax. (#384) Generated with perl -pi -e 's/\"\$\{([a-zA-Z0-9._-]*)\}\"/$1/g' $(find ./ -name '*.tf') Copied from cl/282012376. --- proxy/terraform/example_config.tf | 8 +-- proxy/terraform/modules/common.tf | 2 +- proxy/terraform/modules/gcs.tf | 4 +- proxy/terraform/modules/gke.tf | 12 ++--- proxy/terraform/modules/gke/cluster.tf | 4 +- proxy/terraform/modules/kms.tf | 4 +- proxy/terraform/modules/networking.tf | 16 +++--- proxy/terraform/modules/networking/dns.tf | 16 +++--- .../modules/networking/loadbalancer.tf | 50 +++++++++---------- proxy/terraform/modules/networking/output.tf | 4 +- proxy/terraform/modules/output.tf | 16 +++--- 11 files changed, 68 insertions(+), 68 deletions(-) diff --git a/proxy/terraform/example_config.tf b/proxy/terraform/example_config.tf index 7541f2731..3849b2420 100644 --- a/proxy/terraform/example_config.tf +++ b/proxy/terraform/example_config.tf @@ -15,17 +15,17 @@ module "proxy" { } output "proxy_service_account" { - value = "${module.proxy.proxy_service_account}" + value = module.proxy.proxy_service_account } output "proxy_name_servers" { - value = "${module.proxy.proxy_name_servers}" + value = module.proxy.proxy_name_servers } output "proxy_instance_groups" { - value = "${module.proxy.proxy_instance_groups}" + value = module.proxy.proxy_instance_groups } output "proxy_ip_addresses" { - value = "${module.proxy.proxy_ip_addresses}" + value = module.proxy.proxy_ip_addresses } diff --git a/proxy/terraform/modules/common.tf b/proxy/terraform/modules/common.tf index ef46ba494..3f66dc69d 100644 --- a/proxy/terraform/modules/common.tf +++ b/proxy/terraform/modules/common.tf @@ -1,4 +1,4 @@ provider "google" { version = ">= 1.13.0" - project = "${var.proxy_project_name}" + project = var.proxy_project_name } diff --git a/proxy/terraform/modules/gcs.tf b/proxy/terraform/modules/gcs.tf index c2ede78d9..25e0b2265 100644 --- a/proxy/terraform/modules/gcs.tf +++ b/proxy/terraform/modules/gcs.tf @@ -1,10 +1,10 @@ resource "google_storage_bucket" "proxy_certificate" { - name = "${var.proxy_certificate_bucket}" + name = var.proxy_certificate_bucket storage_class = "MULTI_REGIONAL" } resource "google_storage_bucket_iam_member" "certificate_viewer" { - bucket = "${google_storage_bucket.proxy_certificate.name}" + bucket = google_storage_bucket.proxy_certificate.name role = "roles/storage.objectViewer" member = "serviceAccount:${google_service_account.proxy_service_account.email}" } diff --git a/proxy/terraform/modules/gke.tf b/proxy/terraform/modules/gke.tf index eb991360f..e52b5a61b 100644 --- a/proxy/terraform/modules/gke.tf +++ b/proxy/terraform/modules/gke.tf @@ -1,25 +1,25 @@ module "proxy_gke_americas" { source = "./gke" proxy_cluster_region = "americas" - proxy_service_account_email = "${google_service_account.proxy_service_account.email}" + proxy_service_account_email = google_service_account.proxy_service_account.email } module "proxy_gke_emea" { source = "./gke" proxy_cluster_region = "emea" - proxy_service_account_email = "${google_service_account.proxy_service_account.email}" + proxy_service_account_email = google_service_account.proxy_service_account.email } module "proxy_gke_apac" { source = "./gke" proxy_cluster_region = "apac" - proxy_service_account_email = "${google_service_account.proxy_service_account.email}" + proxy_service_account_email = google_service_account.proxy_service_account.email } locals { "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}" + 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 19f53ef86..baff2132e 100644 --- a/proxy/terraform/modules/gke/cluster.tf +++ b/proxy/terraform/modules/gke/cluster.tf @@ -4,7 +4,7 @@ locals { resource "google_container_cluster" "proxy_cluster" { name = "proxy-cluster-${var.proxy_cluster_region}" - zone = "${local.proxy_cluster_zone}" + zone = local.proxy_cluster_zone timeouts { update = "30m" @@ -19,7 +19,7 @@ resource "google_container_cluster" "proxy_cluster" { "proxy-cluster", ] - service_account = "${var.proxy_service_account_email}" + service_account = var.proxy_service_account_email oauth_scopes = [ "https://www.googleapis.com/auth/cloud-platform", diff --git a/proxy/terraform/modules/kms.tf b/proxy/terraform/modules/kms.tf index ccfbd1387..8f3f6083d 100644 --- a/proxy/terraform/modules/kms.tf +++ b/proxy/terraform/modules/kms.tf @@ -1,10 +1,10 @@ resource "google_kms_key_ring" "proxy_key_ring" { - name = "${var.proxy_key_ring}" + name = var.proxy_key_ring location = "global" } resource "google_kms_crypto_key" "proxy_key" { - name = "${var.proxy_key}" + name = var.proxy_key key_ring = google_kms_key_ring.proxy_key_ring.self_link lifecycle { diff --git a/proxy/terraform/modules/networking.tf b/proxy/terraform/modules/networking.tf index 41550093a..151ba7929 100644 --- a/proxy/terraform/modules/networking.tf +++ b/proxy/terraform/modules/networking.tf @@ -5,17 +5,17 @@ resource "google_dns_managed_zone" "proxy_domain" { module "proxy_networking" { source = "./networking" - proxy_instance_groups = "${local.proxy_instance_groups}" - proxy_ports = "${var.proxy_ports}" - proxy_domain = "${google_dns_managed_zone.proxy_domain.name}" - proxy_domain_name = "${google_dns_managed_zone.proxy_domain.dns_name}" + proxy_instance_groups = local.proxy_instance_groups + proxy_ports = var.proxy_ports + proxy_domain = google_dns_managed_zone.proxy_domain.name + proxy_domain_name = google_dns_managed_zone.proxy_domain.dns_name } module "proxy_networking_canary" { source = "./networking" - proxy_instance_groups = "${local.proxy_instance_groups}" + proxy_instance_groups = local.proxy_instance_groups suffix = "-canary" - proxy_ports = "${var.proxy_ports_canary}" - proxy_domain = "${google_dns_managed_zone.proxy_domain.name}" - proxy_domain_name = "${google_dns_managed_zone.proxy_domain.dns_name}" + proxy_ports = var.proxy_ports_canary + proxy_domain = google_dns_managed_zone.proxy_domain.name + proxy_domain_name = google_dns_managed_zone.proxy_domain.dns_name } diff --git a/proxy/terraform/modules/networking/dns.tf b/proxy/terraform/modules/networking/dns.tf index b5db062ea..48ac6e9f3 100644 --- a/proxy/terraform/modules/networking/dns.tf +++ b/proxy/terraform/modules/networking/dns.tf @@ -2,30 +2,30 @@ resource "google_dns_record_set" "proxy_epp_a_record" { name = "epp${var.suffix}.${var.proxy_domain_name}" type = "A" ttl = 300 - managed_zone = "${var.proxy_domain}" - rrdatas = ["${google_compute_global_address.proxy_ipv4_address.address}"] + managed_zone = var.proxy_domain + rrdatas = [google_compute_global_address.proxy_ipv4_address.address] } resource "google_dns_record_set" "proxy_epp_aaaa_record" { name = "epp${var.suffix}.${var.proxy_domain_name}" type = "AAAA" ttl = 300 - managed_zone = "${var.proxy_domain}" - rrdatas = ["${google_compute_global_address.proxy_ipv6_address.address}"] + managed_zone = var.proxy_domain + rrdatas = [google_compute_global_address.proxy_ipv6_address.address] } resource "google_dns_record_set" "proxy_whois_a_record" { name = "whois${var.suffix}.${var.proxy_domain_name}" type = "A" ttl = 300 - managed_zone = "${var.proxy_domain}" - rrdatas = ["${google_compute_global_address.proxy_ipv4_address.address}"] + managed_zone = var.proxy_domain + rrdatas = [google_compute_global_address.proxy_ipv4_address.address] } resource "google_dns_record_set" "proxy_whois_aaaa_record" { name = "whois${var.suffix}.${var.proxy_domain_name}" type = "AAAA" ttl = 300 - managed_zone = "${var.proxy_domain}" - rrdatas = ["${google_compute_global_address.proxy_ipv6_address.address}"] + managed_zone = var.proxy_domain + rrdatas = [google_compute_global_address.proxy_ipv6_address.address] } diff --git a/proxy/terraform/modules/networking/loadbalancer.tf b/proxy/terraform/modules/networking/loadbalancer.tf index 7f4eb7704..17040acfb 100644 --- a/proxy/terraform/modules/networking/loadbalancer.tf +++ b/proxy/terraform/modules/networking/loadbalancer.tf @@ -56,7 +56,7 @@ resource "google_compute_health_check" "proxy_http_health_check" { resource "google_compute_url_map" "proxy_url_map" { name = "proxy-url-map${var.suffix}" - default_service = "${google_compute_backend_service.http_whois_backend_service.self_link}" + default_service = google_compute_backend_service.http_whois_backend_service.self_link } resource "google_compute_backend_service" "epp_backend_service" { @@ -78,7 +78,7 @@ resource "google_compute_backend_service" "epp_backend_service" { } health_checks = [ - "${google_compute_health_check.proxy_health_check.self_link}", + google_compute_health_check.proxy_health_check.self_link, ] } @@ -101,7 +101,7 @@ resource "google_compute_backend_service" "whois_backend_service" { } health_checks = [ - "${google_compute_health_check.proxy_health_check.self_link}", + google_compute_health_check.proxy_health_check.self_link, ] } @@ -124,7 +124,7 @@ resource "google_compute_backend_service" "https_whois_backend_service" { } health_checks = [ - "${google_compute_health_check.proxy_health_check.self_link}", + google_compute_health_check.proxy_health_check.self_link, ] } @@ -147,84 +147,84 @@ resource "google_compute_backend_service" "http_whois_backend_service" { } health_checks = [ - "${google_compute_health_check.proxy_http_health_check.self_link}", + google_compute_health_check.proxy_http_health_check.self_link, ] } resource "google_compute_target_tcp_proxy" "epp_tcp_proxy" { name = "epp-tcp-proxy${var.suffix}" proxy_header = "PROXY_V1" - backend_service = "${google_compute_backend_service.epp_backend_service.self_link}" + backend_service = google_compute_backend_service.epp_backend_service.self_link } resource "google_compute_target_tcp_proxy" "whois_tcp_proxy" { name = "whois-tcp-proxy${var.suffix}" proxy_header = "PROXY_V1" - backend_service = "${google_compute_backend_service.whois_backend_service.self_link}" + backend_service = google_compute_backend_service.whois_backend_service.self_link } resource "google_compute_target_tcp_proxy" "https_whois_tcp_proxy" { name = "https-whois-tcp-proxy${var.suffix}" - backend_service = "${google_compute_backend_service.https_whois_backend_service.self_link}" + backend_service = google_compute_backend_service.https_whois_backend_service.self_link } resource "google_compute_target_http_proxy" "http_whois_http_proxy" { name = "http-whois-tcp-proxy${var.suffix}" - url_map = "${google_compute_url_map.proxy_url_map.self_link}" + url_map = google_compute_url_map.proxy_url_map.self_link } resource "google_compute_global_forwarding_rule" "epp_ipv4_forwarding_rule" { name = "epp-ipv4-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv4_address.address}" - target = "${google_compute_target_tcp_proxy.epp_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv4_address.address + target = google_compute_target_tcp_proxy.epp_tcp_proxy.self_link port_range = "700" } resource "google_compute_global_forwarding_rule" "epp_ipv6_forwarding_rule" { name = "epp-ipv6-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv6_address.address}" - target = "${google_compute_target_tcp_proxy.epp_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv6_address.address + target = google_compute_target_tcp_proxy.epp_tcp_proxy.self_link port_range = "700" } resource "google_compute_global_forwarding_rule" "whois_ipv4_forwarding_rule" { name = "whois-ipv4-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv4_address.address}" - target = "${google_compute_target_tcp_proxy.whois_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv4_address.address + target = google_compute_target_tcp_proxy.whois_tcp_proxy.self_link port_range = "43" } resource "google_compute_global_forwarding_rule" "whois_ipv6_forwarding_rule" { name = "whois-ipv6-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv6_address.address}" - target = "${google_compute_target_tcp_proxy.whois_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv6_address.address + target = google_compute_target_tcp_proxy.whois_tcp_proxy.self_link port_range = "43" } resource "google_compute_global_forwarding_rule" "https_whois_ipv4_forwarding_rule" { name = "https-whois-ipv4-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv4_address.address}" - target = "${google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv4_address.address + target = google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link port_range = "443" } resource "google_compute_global_forwarding_rule" "https_whois_ipv6_forwarding_rule" { name = "https-whois-ipv6-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv6_address.address}" - target = "${google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv6_address.address + target = google_compute_target_tcp_proxy.https_whois_tcp_proxy.self_link port_range = "443" } resource "google_compute_global_forwarding_rule" "http_whois_ipv4_forwarding_rule" { name = "http-whois-ipv4-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv4_address.address}" - target = "${google_compute_target_http_proxy.http_whois_http_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv4_address.address + target = google_compute_target_http_proxy.http_whois_http_proxy.self_link port_range = "80" } resource "google_compute_global_forwarding_rule" "http_whois_ipv6_forwarding_rule" { name = "http-whois-ipv6-forwarding-rule${var.suffix}" - ip_address = "${google_compute_global_address.proxy_ipv6_address.address}" - target = "${google_compute_target_http_proxy.http_whois_http_proxy.self_link}" + ip_address = google_compute_global_address.proxy_ipv6_address.address + target = google_compute_target_http_proxy.http_whois_http_proxy.self_link port_range = "80" } diff --git a/proxy/terraform/modules/networking/output.tf b/proxy/terraform/modules/networking/output.tf index 7a269f358..6cea7883d 100644 --- a/proxy/terraform/modules/networking/output.tf +++ b/proxy/terraform/modules/networking/output.tf @@ -1,7 +1,7 @@ output "proxy_ipv4_address" { - value = "${google_compute_global_address.proxy_ipv4_address.address}" + value = google_compute_global_address.proxy_ipv4_address.address } output "proxy_ipv6_address" { - value = "${google_compute_global_address.proxy_ipv6_address.address}" + value = google_compute_global_address.proxy_ipv6_address.address } diff --git a/proxy/terraform/modules/output.tf b/proxy/terraform/modules/output.tf index b61b422dd..538d08197 100644 --- a/proxy/terraform/modules/output.tf +++ b/proxy/terraform/modules/output.tf @@ -1,23 +1,23 @@ output "proxy_name_servers" { - value = "${google_dns_managed_zone.proxy_domain.name_servers}" + value = google_dns_managed_zone.proxy_domain.name_servers } output "proxy_instance_groups" { - value = "${local.proxy_instance_groups}" + value = local.proxy_instance_groups } output "proxy_service_account" { value = { - email = "${google_service_account.proxy_service_account.email}" - client_id = "${google_service_account.proxy_service_account.unique_id}" + email = google_service_account.proxy_service_account.email + client_id = google_service_account.proxy_service_account.unique_id } } output "proxy_ip_addresses" { value = { - ipv4 = "${module.proxy_networking.proxy_ipv4_address}" - ipv6 = "${module.proxy_networking.proxy_ipv6_address}" - ipv4_canary = "${module.proxy_networking_canary.proxy_ipv4_address}" - ipv6_canary = "${module.proxy_networking_canary.proxy_ipv6_address}" + ipv4 = module.proxy_networking.proxy_ipv4_address + ipv6 = module.proxy_networking.proxy_ipv6_address + ipv4_canary = module.proxy_networking_canary.proxy_ipv4_address + ipv6_canary = module.proxy_networking_canary.proxy_ipv6_address } }