File tree Expand file tree Collapse file tree 13 files changed +27
-27
lines changed Expand file tree Collapse file tree 13 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 1717# [START cloudrun_access_control_parent_tag]
1818# [START cloudrun_service_access_control_run_service]
1919resource "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
Original file line number Diff line number Diff line change 1616
1717# [START cloudrun_service_add_tag]
1818resource "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 }
Original file line number Diff line number Diff line change 1717# [START cloudrun_custom_domain_mapping_parent_tag]
1818# [START cloudrun_custom_domain_mapping_run_service]
1919resource "google_cloud_run_v2_service" "default" {
20- name = " cloud-run-srv "
20+ name = " custom-domain "
2121 location = " us-central1"
2222 template {
2323 containers {
Original file line number Diff line number Diff line change 1616
1717# [START cloudrun_service_deploy_tag]
1818resource "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 }
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ resource "google_service_account" "cloudrun_service_identity" {
2323
2424# [START cloudrun_service_identity_run_service]
2525resource "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
Original file line number Diff line number Diff line change 1919# [START cloudrun_noauth_parent_tag]
2020# [START cloudrun_service_noauth]
2121resource "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
Original file line number Diff line number Diff line change 1616
1717# [START cloudrun_service_remove_tag]
1818resource "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}
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ resource "google_secret_manager_secret_iam_member" "default" {
6161
6262# [START cloudrun_secret_manager_mounted]
6363resource "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]
9696resource "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
Original file line number Diff line number Diff line change 1616
1717# [START cloudrun_service_traffic_gradual_rollout]
1818resource "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
Original file line number Diff line number Diff line change 1717# [START cloudrun_traffic_latest_revision_parent_tag]
1818# [START cloudrun_service_traffic_latest]
1919resource "google_cloud_run_v2_service" "default" {
20- name = " cloudrun-srv "
20+ name = " my-service "
2121 location = " us-central1"
2222
2323 template {}
You can’t perform that action at this time.
0 commit comments