From b4ccd902d3af81da3bca1a758754859ab26642d4 Mon Sep 17 00:00:00 2001 From: nitramiz Date: Thu, 6 Jan 2022 09:18:30 -0800 Subject: [PATCH] TF: make staging deploys proactive/prod opportunistic + don't create tor backend service on staging --- terraform/modules/blc/main.tf | 2 +- terraform/modules/lb/main.tf | 2 +- terraform/modules/lb/network.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform/modules/blc/main.tf b/terraform/modules/blc/main.tf index 580f35e..8f55a5b 100644 --- a/terraform/modules/blc/main.tf +++ b/terraform/modules/blc/main.tf @@ -26,7 +26,7 @@ resource "google_compute_instance_group_manager" "blc" { } update_policy { - type = "PROACTIVE" + type = var.env == "staging" ? "PROACTIVE": "OPPORTUNISTIC" minimal_action = "RESTART" replacement_method = "RECREATE" max_surge_fixed = 0 diff --git a/terraform/modules/lb/main.tf b/terraform/modules/lb/main.tf index 3363ba9..2c97507 100644 --- a/terraform/modules/lb/main.tf +++ b/terraform/modules/lb/main.tf @@ -16,7 +16,7 @@ resource "google_compute_region_instance_group_manager" "satapi-lb" { } update_policy { - type = "OPPORTUNISTIC" + type = var.env == "staging" ? "PROACTIVE": "OPPORTUNISTIC" minimal_action = "RESTART" replacement_method = "RECREATE" max_surge_fixed = 0 diff --git a/terraform/modules/lb/network.tf b/terraform/modules/lb/network.tf index 36cf133..5b981b9 100644 --- a/terraform/modules/lb/network.tf +++ b/terraform/modules/lb/network.tf @@ -27,7 +27,7 @@ resource "google_compute_backend_service" "satapi-lb-tor" { protocol = "HTTP" port_name = "http81" project = var.project - count = var.create_resources + count = var.env == "staging" ? 0 : var.create_resources backend { group = google_compute_region_instance_group_manager.satapi-lb[0].instance_group