From 68947da84e8de73b3cadfd8fb6453b15db7964dd Mon Sep 17 00:00:00 2001 From: Aaron Levy Date: Fri, 5 Sep 2025 08:32:12 -0700 Subject: [PATCH] Fixing adherence to GCP instance count variables (#101) Fixing adherence to GCP instance count variables --- gcp/byo-project/cloud_run.tf | 10 ++++++---- gcp/byo-project/loadbalancer.tf | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gcp/byo-project/cloud_run.tf b/gcp/byo-project/cloud_run.tf index f94562a..7bb2f0b 100644 --- a/gcp/byo-project/cloud_run.tf +++ b/gcp/byo-project/cloud_run.tf @@ -63,12 +63,14 @@ module "fleet-service" { } ingress = "INGRESS_TRAFFIC_INTERNAL_LOAD_BALANCER" timeout = "300s" + service_scaling = { - min_instance_count = 0 + min_instance_count = var.fleet_config.min_instance_count } + template_scaling = { - min_instance_count = 0 - max_instance_count = 0 + min_instance_count = 0 # Google suggests using service-level minimum instance count + max_instance_count = var.fleet_config.max_instance_count } containers = [ @@ -222,4 +224,4 @@ resource "google_cloud_run_v2_service_iam_member" "allow_lb_invoker" { name = module.fleet-service.service_name role = "roles/run.invoker" member = "allUsers" -} \ No newline at end of file +} diff --git a/gcp/byo-project/loadbalancer.tf b/gcp/byo-project/loadbalancer.tf index 8b25541..bfb5a2f 100644 --- a/gcp/byo-project/loadbalancer.tf +++ b/gcp/byo-project/loadbalancer.tf @@ -26,9 +26,9 @@ module "fleet_lb" { # Backend Configuration backends = { default = { - description = "Backend for Fleet Cloud Run service" - enable_cdn = false # Set to true if you want Cloud CDN - protocol = "HTTP" + description = "Backend for Fleet Cloud Run service" + enable_cdn = false # Set to true if you want Cloud CDN + protocol = "HTTP" groups = [ { group = google_compute_region_network_endpoint_group.neg.id