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