Skip to content

Commit 193543d

Browse files
committed
fix(run): add deletion_protection
1 parent 4d25091 commit 193543d

File tree

9 files changed

+20
-0
lines changed

9 files changed

+20
-0
lines changed

run/add_tag/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {}
2325

2426
# Define the traffic split for each revision

run/custom_domain_mapping/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
resource "google_cloud_run_v2_service" "default" {
2020
name = "custom-domain"
2121
location = "us-central1"
22+
23+
deletion_protection = false # set to true to prevent destruction of the resource
24+
2225
template {
2326
containers {
2427
image = "us-docker.pkg.dev/cloudrun/container/hello"

run/pubsub/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ resource "google_project_service" "cloudrun_api" {
2828
resource "google_cloud_run_v2_service" "default" {
2929
name = "pubsub-tutorial"
3030
location = "us-central1"
31+
32+
deletion_protection = false # set to true to prevent destruction of the resource
33+
3134
template {
3235
containers {
3336
image = "us-docker.pkg.dev/cloudrun/container/hello" # Replace with newly created image gcr.io/<project_id>/pubsub

run/remove_tag/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {}
2325

2426
# Define the traffic split for each revision

run/traffic_gradual_rollout/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {
2325
containers {
2426
# Image or image tag must be different from previous revision

run/traffic_latest_revision/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ resource "google_cloud_run_v2_service" "default" {
2020
name = "my-service"
2121
location = "us-central1"
2222

23+
deletion_protection = false # set to true to prevent destruction of the resource
24+
2325
template {}
2426

2527
traffic {

run/traffic_rollback/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {}
2325

2426
traffic {

run/traffic_split/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {
2325
containers {
2426
image = "us-docker.pkg.dev/cloudrun/container/hello"

run/traffic_split_tag/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "google_cloud_run_v2_service" "default" {
1919
name = "my-service"
2020
location = "us-central1"
2121

22+
deletion_protection = false # set to true to prevent destruction of the resource
23+
2224
template {}
2325

2426
# Define the traffic split for each revision

0 commit comments

Comments
 (0)