From 0ace53fea8725009675bac4223f53d48175916c4 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Mon, 3 Jun 2019 16:20:27 -0700 Subject: [PATCH] Use random name in instance template to enable parallel testing (#1872) Merged PR #1872. --- build/terraform | 2 +- build/terraform-beta | 2 +- .../examples/global_forwarding_rule_internal.tf.erb | 12 ++++++------ ...source_compute_global_forwarding_rule_test.go.erb | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/terraform b/build/terraform index a33eca08d2e3..479219b820a6 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit a33eca08d2e3781c615e165ca6d88012b0c0224a +Subproject commit 479219b820a6236660e3744cfce3f1caf96d7bcb diff --git a/build/terraform-beta b/build/terraform-beta index de2b8ddffca1..26a903ce8656 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit de2b8ddffca12c3110889c2bafe72b36b7a0f9d8 +Subproject commit 26a903ce8656d11e97397d967c46a55be87889c8 diff --git a/templates/terraform/examples/global_forwarding_rule_internal.tf.erb b/templates/terraform/examples/global_forwarding_rule_internal.tf.erb index 2713b2d9eab3..5b99a6bd4846 100644 --- a/templates/terraform/examples/global_forwarding_rule_internal.tf.erb +++ b/templates/terraform/examples/global_forwarding_rule_internal.tf.erb @@ -45,7 +45,7 @@ resource "google_compute_backend_service" "default" { load_balancing_scheme = "INTERNAL_SELF_MANAGED" backend { - group = "${google_compute_instance_group_manager.foobar.instance_group}" + group = "${google_compute_instance_group_manager.igm.instance_group}" balancing_mode = "RATE" capacity_scaler = 0.4 max_rate_per_instance = 50 @@ -60,21 +60,21 @@ data "google_compute_image" "debian_image" { project = "debian-cloud" } -resource "google_compute_instance_group_manager" "foobar" { +resource "google_compute_instance_group_manager" "igm" { provider = "google-beta" name = "igm-internal" version { - instance_template = "${google_compute_instance_template.foobar.self_link}" + instance_template = "${google_compute_instance_template.instance_template.self_link}" name = "primary" } - base_instance_name = "foobar" + base_instance_name = "internal-glb" zone = "us-central1-f" target_size = 1 } -resource "google_compute_instance_template" "foobar" { +resource "google_compute_instance_template" "instance_template" { provider = "google-beta" - name = "instance-template-internal" + name = "template-<%= ctx[:vars]['backend_service_name'] %>" machine_type = "n1-standard-1" network_interface { diff --git a/third_party/terraform/tests/resource_compute_global_forwarding_rule_test.go.erb b/third_party/terraform/tests/resource_compute_global_forwarding_rule_test.go.erb index 14f2cd618385..44d12767302c 100644 --- a/third_party/terraform/tests/resource_compute_global_forwarding_rule_test.go.erb +++ b/third_party/terraform/tests/resource_compute_global_forwarding_rule_test.go.erb @@ -393,7 +393,7 @@ resource "google_compute_backend_service" "default" { load_balancing_scheme = "INTERNAL_SELF_MANAGED" backend { - group = "${google_compute_instance_group_manager.foobar.instance_group}" + group = "${google_compute_instance_group_manager.igm.instance_group}" balancing_mode = "RATE" capacity_scaler = 0.4 max_rate_per_instance = 50 @@ -438,18 +438,18 @@ data "google_compute_image" "debian_image" { project = "debian-cloud" } -resource "google_compute_instance_group_manager" "foobar" { +resource "google_compute_instance_group_manager" "igm" { name = "igm-internal" version { - instance_template = "${google_compute_instance_template.foobar.self_link}" + instance_template = "${google_compute_instance_template.instance_template.self_link}" name = "primary" } - base_instance_name = "foobar" + base_instance_name = "internal-igm" zone = "us-central1-f" target_size = 1 } -resource "google_compute_instance_template" "foobar" { +resource "google_compute_instance_template" "instance_template" { name = "instance-template-internal" machine_type = "n1-standard-1"