Skip to content

Commit

Permalink
chore: set cloud run deletion protection to false
Browse files Browse the repository at this point in the history
  • Loading branch information
assafgi committed Dec 4, 2024
1 parent dd57162 commit d9d17a8
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions cloudrun.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ locals {
}
# ======================== deploy ============================
resource "google_cloud_run_v2_service" "cloud_internal" {
count = local.is_using_cloudfunctions ? 0 : 1
name = local.cloud_internal_function_name
description = "deploy, fetch, resize, clusterize, clusterize finalization, join, join_finalization, terminate, transient, terminate_cluster, scale_up functions"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
count = local.is_using_cloudfunctions ? 0 : 1
name = local.cloud_internal_function_name
description = "deploy, fetch, resize, clusterize, clusterize finalization, join, join_finalization, terminate, transient, terminate_cluster, scale_up functions"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
deletion_protection = false
traffic {
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
percent = 100
Expand Down Expand Up @@ -64,11 +65,12 @@ resource "google_cloud_run_v2_service_iam_member" "cloud_internal_invoker" {

# ======================== scale_down ============================
resource "google_cloud_run_v2_service" "scale_down" {
count = local.is_using_cloudfunctions ? 0 : 1
name = "${var.prefix}-${var.cluster_name}-scale-down"
description = "scale cluster down"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
count = local.is_using_cloudfunctions ? 0 : 1
name = "${var.prefix}-${var.cluster_name}-scale-down"
description = "scale cluster down"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
deletion_protection = false
traffic {
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
percent = 100
Expand Down Expand Up @@ -114,11 +116,12 @@ resource "google_cloud_run_v2_service_iam_member" "weka_internal_invoker" {

# ======================== status ============================
resource "google_cloud_run_v2_service" "status" {
count = local.is_using_cloudfunctions ? 0 : 1
name = "${var.prefix}-${var.cluster_name}-status"
description = "get cluster status"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
count = local.is_using_cloudfunctions ? 0 : 1
name = "${var.prefix}-${var.cluster_name}-status"
description = "get cluster status"
location = lookup(var.cloud_functions_region_map, var.region, var.region)
ingress = local.cloudrun_ingress_map[local.function_ingress_settings]
deletion_protection = false
traffic {
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_LATEST"
percent = 100
Expand Down

0 comments on commit d9d17a8

Please sign in to comment.