Skip to content

Commit cbc5075

Browse files
committed
fix(cloudrun): update cloud run services names to unique values
fixes #164
1 parent 94a27ca commit cbc5075

File tree

13 files changed

+27
-27
lines changed

13 files changed

+27
-27
lines changed

run/access_control/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# [START cloudrun_access_control_parent_tag]
1818
# [START cloudrun_service_access_control_run_service]
1919
resource "google_cloud_run_v2_service" "default" {
20-
name = "cloud-run-srv"
20+
name = "public-service"
2121
location = "us-central1"
2222

2323
deletion_protection = false # set to "true" in production

run/add_tag/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# [START cloudrun_service_add_tag]
1818
resource "google_cloud_run_v2_service" "default" {
19-
name = "cloudrun-srv"
19+
name = "my-service"
2020
location = "us-central1"
2121

2222
template {}
@@ -26,14 +26,14 @@ resource "google_cloud_run_v2_service" "default" {
2626
traffic {
2727
percent = 100
2828
# This revision needs to already exist
29-
revision = "cloudrun-srv-green"
29+
revision = "green"
3030
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
3131
}
3232

3333
traffic {
3434
# Deploy new revision with 0% traffic
3535
percent = 0
36-
revision = "cloudrun-srv-blue"
36+
revision = "blue"
3737
tag = "tag-name"
3838
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
3939
}

run/custom_domain_mapping/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# [START cloudrun_custom_domain_mapping_parent_tag]
1818
# [START cloudrun_custom_domain_mapping_run_service]
1919
resource "google_cloud_run_v2_service" "default" {
20-
name = "cloud-run-srv"
20+
name = "custom-domain"
2121
location = "us-central1"
2222
template {
2323
containers {

run/deploy_tag/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# [START cloudrun_service_deploy_tag]
1818
resource "google_cloud_run_v2_service" "default" {
19-
name = "cloudrun-srv"
19+
name = "my-service"
2020
location = "us-central1"
2121

2222
deletion_protection = false # set to "true" in production
@@ -26,22 +26,22 @@ resource "google_cloud_run_v2_service" "default" {
2626
# image or tag must be different from previous revision
2727
image = "us-docker.pkg.dev/cloudrun/container/hello"
2828
}
29-
revision = "cloudrun-srv-blue"
29+
revision = "blue"
3030
}
3131

3232
# Define the traffic split for each revision
3333
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service#traffic
3434
traffic {
3535
percent = 100
3636
# This revision needs to already exist
37-
revision = "cloudrun-srv-green"
37+
revision = "green"
3838
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
3939
}
4040

4141
traffic {
4242
# Deploy new revision with 0% traffic
4343
percent = 0
44-
revision = "cloudrun-srv-blue"
44+
revision = "blue"
4545
tag = "tag-name"
4646
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
4747
}

run/identity/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resource "google_service_account" "cloudrun_service_identity" {
2323

2424
# [START cloudrun_service_identity_run_service]
2525
resource "google_cloud_run_v2_service" "default" {
26-
name = "cloud-run-srv"
26+
name = "id-service"
2727
location = "us-central1"
2828

2929
deletion_protection = false # set to "true" in production

run/noauth/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# [START cloudrun_noauth_parent_tag]
2020
# [START cloudrun_service_noauth]
2121
resource "google_cloud_run_v2_service" "default" {
22-
name = "cloudrun-srv"
22+
name = "my-public-service"
2323
location = "us-central1"
2424

2525
deletion_protection = false # set to "true" in production

run/remove_tag/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# [START cloudrun_service_remove_tag]
1818
resource "google_cloud_run_v2_service" "default" {
19-
name = "cloudrun-srv"
19+
name = "my-service"
2020
location = "us-central1"
2121

2222
template {}
@@ -26,7 +26,7 @@ resource "google_cloud_run_v2_service" "default" {
2626
traffic {
2727
percent = 100
2828
# This revision needs to already exist
29-
revision = "cloudrun-srv-green"
29+
revision = "green"
3030
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
3131
}
3232

@@ -35,7 +35,7 @@ resource "google_cloud_run_v2_service" "default" {
3535
# Keep revision at 0% traffic
3636
percent = 0
3737
# This revision needs to already exist
38-
revision = "cloudrun-srv-blue"
38+
revision = "blue"
3939
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
4040
}
4141
}

run/secret_manager/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ resource "google_secret_manager_secret_iam_member" "default" {
6161

6262
# [START cloudrun_secret_manager_mounted]
6363
resource "google_cloud_run_v2_service" "mounted_secret" {
64-
name = "cloudrun-srv-mounted-secret"
64+
name = "service-with-mounted-secret"
6565
location = "us-central1"
6666
ingress = "INGRESS_TRAFFIC_ALL"
6767

@@ -94,7 +94,7 @@ resource "google_cloud_run_v2_service" "mounted_secret" {
9494

9595
# [START cloudrun_secret_manager_env_variable]
9696
resource "google_cloud_run_v2_service" "env_variable_secret" {
97-
name = "cloudrun-srv-env-var-secret"
97+
name = "service-with-env-var-secret"
9898
location = "us-central1"
9999
ingress = "INGRESS_TRAFFIC_ALL"
100100

run/traffic_gradual_rollout/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# [START cloudrun_service_traffic_gradual_rollout]
1818
resource "google_cloud_run_v2_service" "default" {
19-
name = "cloudrun-srv"
19+
name = "my-service"
2020
location = "us-central1"
2121

2222
template {
@@ -31,7 +31,7 @@ resource "google_cloud_run_v2_service" "default" {
3131
traffic {
3232
percent = 100
3333
# This revision needs to already exist
34-
revision = "cloudrun-srv-green"
34+
revision = "green"
3535
type = "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION"
3636
}
3737

run/traffic_latest_revision/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# [START cloudrun_traffic_latest_revision_parent_tag]
1818
# [START cloudrun_service_traffic_latest]
1919
resource "google_cloud_run_v2_service" "default" {
20-
name = "cloudrun-srv"
20+
name = "my-service"
2121
location = "us-central1"
2222

2323
template {}

0 commit comments

Comments
 (0)