From 99fee915afa876791cd38c62af4472d19571d3c1 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Wed, 26 Apr 2023 12:44:03 +1000 Subject: [PATCH 1/2] fix: update gce-vpc to use random suffix --- infra/postdeployment.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/infra/postdeployment.tf b/infra/postdeployment.tf index c7165e5d..ea7a0d63 100644 --- a/infra/postdeployment.tf +++ b/infra/postdeployment.tf @@ -20,11 +20,11 @@ module "gce-vpc" { source = "terraform-google-modules/network/google" version = "~> 7.0" project_id = var.project_id - network_name = "gce-init-network" + network_name = var.random_suffix ? "gce-init-network-${random_id.suffix.hex}" : "gce-init-network" subnets = [ { - subnet_name = "subnet-gce-int" + subnet_name = var.random_suffix ? "subnet-gce-int-${random_id.suffix.hex}" : "subnet-gce-int" subnet_ip = "10.10.10.0/24" subnet_region = var.region } @@ -42,7 +42,7 @@ resource "google_compute_instance" "initialize" { google_cloud_run_v2_job.client, ] - name = "head-start-initialize" + name = var.random_suffix ? "head-start-initialize-${random_id.suffix.hex}" : "head-start-initialize" machine_type = "n1-standard-1" zone = var.zone desired_status = "RUNNING" From 9af2904acc406ff36ed51c6a3ce44a95445e4191 Mon Sep 17 00:00:00 2001 From: Katie McLaughlin Date: Wed, 26 Apr 2023 12:55:07 +1000 Subject: [PATCH 2/2] fix: don't have variable subnet name --- infra/postdeployment.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/postdeployment.tf b/infra/postdeployment.tf index ea7a0d63..c81f2675 100644 --- a/infra/postdeployment.tf +++ b/infra/postdeployment.tf @@ -24,7 +24,7 @@ module "gce-vpc" { subnets = [ { - subnet_name = var.random_suffix ? "subnet-gce-int-${random_id.suffix.hex}" : "subnet-gce-int" + subnet_name = "subnet-gce-int" subnet_ip = "10.10.10.0/24" subnet_region = var.region }