Skip to content

Commit a9270d3

Browse files
feat: move emptydir to GA for cloudrun and cloudrunv2 (#12230) (#844)
[upstream:8a6f281bad55b80c3e9f6d739729cb5d78646ab3] Signed-off-by: Modular Magician <[email protected]>
1 parent fdfefb4 commit a9270d3

File tree

2 files changed

+13
-18
lines changed
  • cloudrunv2_job_emptydir
  • cloudrunv2_service_multicontainer

2 files changed

+13
-18
lines changed

cloudrunv2_job_emptydir/main.tf

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
resource "google_cloud_run_v2_job" "default" {
2-
provider = google-beta
32
name = "cloudrun-job-${local.name_suffix}"
43
location = "us-central1"
5-
launch_stage = "BETA"
4+
deletion_protection = false
65
template {
76
template {
87
containers {
9-
image = "us-docker.pkg.dev/cloudrun/container/hello"
8+
image = "us-docker.pkg.dev/cloudrun/container/job"
109
volume_mounts {
1110
name = "empty-dir-volume"
1211
mount_path = "/mnt"
@@ -21,10 +20,4 @@ resource "google_cloud_run_v2_job" "default" {
2120
}
2221
}
2322
}
24-
25-
lifecycle {
26-
ignore_changes = [
27-
launch_stage,
28-
]
29-
}
3023
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
resource "google_cloud_run_v2_service" "default" {
2-
provider = google-beta
32
name = "cloudrun-service-${local.name_suffix}"
43
location = "us-central1"
5-
launch_stage = "BETA"
4+
deletion_protection = false
65
ingress = "INGRESS_TRAFFIC_ALL"
76
template {
87
containers {
@@ -14,12 +13,21 @@ resource "google_cloud_run_v2_service" "default" {
1413
depends_on = ["hello-2"]
1514
volume_mounts {
1615
name = "empty-dir-volume"
17-
mount_path = "/mnt"
16+
mount_path = "/mnt"
1817
}
1918
}
2019
containers {
2120
name = "hello-2"
2221
image = "us-docker.pkg.dev/cloudrun/container/hello"
22+
env {
23+
name = "PORT"
24+
value = "8081"
25+
}
26+
startup_probe {
27+
http_get {
28+
port = 8081
29+
}
30+
}
2331
}
2432
volumes {
2533
name = "empty-dir-volume"
@@ -29,10 +37,4 @@ resource "google_cloud_run_v2_service" "default" {
2937
}
3038
}
3139
}
32-
33-
lifecycle {
34-
ignore_changes = [
35-
launch_stage,
36-
]
37-
}
3840
}

0 commit comments

Comments
 (0)