From e3d44ad32651e6caf1d541e21093f10e9b488e70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 05:04:58 +0000 Subject: [PATCH 1/3] Initial plan From 6dbcb7ea4e25b13157b46cce9c3923e5418dbc86 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 05:06:41 +0000 Subject: [PATCH 2/3] Make VMs private and require network/subnetwork variables Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com> --- container-vm/main.tf | 9 +++------ container-vm/variables.tf | 10 ++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/container-vm/main.tf b/container-vm/main.tf index 6767079..41ec1a1 100644 --- a/container-vm/main.tf +++ b/container-vm/main.tf @@ -31,13 +31,10 @@ resource "google_compute_instance_template" "container_vm_template" { boot = true } - # Network configuration + # Network configuration (private VM - no external IP) network_interface { - network = "default" - subnetwork = null - - # Assign an external IP address (access_config is required for external IP) - access_config {} + network = var.network + subnetwork = var.subnetwork } # Service Account configuration (needed for Google Cloud API access, including image pulls) diff --git a/container-vm/variables.tf b/container-vm/variables.tf index c2a8c6e..4218a1a 100644 --- a/container-vm/variables.tf +++ b/container-vm/variables.tf @@ -73,3 +73,13 @@ variable "source_image_project" { default = "cos-cloud" } +variable "network" { + description = "The VPC network to attach the VM to." + type = string +} + +variable "subnetwork" { + description = "The subnetwork to attach the VM to." + type = string +} + From a0935d84215c8fe381d954037eab0048a8adf9a9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 05:07:16 +0000 Subject: [PATCH 3/3] Improve variable descriptions for network and subnetwork Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com> --- container-vm/variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container-vm/variables.tf b/container-vm/variables.tf index 4218a1a..876fa93 100644 --- a/container-vm/variables.tf +++ b/container-vm/variables.tf @@ -74,12 +74,12 @@ variable "source_image_project" { } variable "network" { - description = "The VPC network to attach the VM to." + description = "The VPC network to attach the VM to (e.g., 'projects/PROJECT/global/networks/NETWORK' or 'NETWORK')." type = string } variable "subnetwork" { - description = "The subnetwork to attach the VM to." + description = "The subnetwork to attach the VM to (e.g., 'projects/PROJECT/regions/REGION/subnetworks/SUBNET' or 'SUBNET')." type = string }