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.
This commit is contained in:
Lai Jiang 2019-11-22 16:08:56 -05:00 committed by GitHub
parent c920f709ef
commit 02846bcbdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 68 deletions

View file

@ -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
}

View file

@ -1,4 +1,4 @@
provider "google" {
version = ">= 1.13.0"
project = "${var.proxy_project_name}"
project = var.proxy_project_name
}

View file

@ -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}"
}

View file

@ -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
}
}

View file

@ -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",

View file

@ -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 {

View file

@ -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
}

View file

@ -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]
}

View file

@ -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"
}

View file

@ -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
}

View file

@ -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
}
}