Skip to content

Commit 432c05d

Browse files
authored
Merge pull request #28 from GoogleCloudPlatform/fix/cloud-run-v2-timeout
fix: buffing up startup probe time for cloud run v2 resource
2 parents 6058365 + c340e2b commit 432c05d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

infra/apis.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ resource "time_sleep" "cloud_run_v2_service" {
4949
google_cloud_run_v2_service.default
5050
]
5151

52-
create_duration = "60s"
52+
create_duration = "45s"
5353
}

infra/main.tf

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ resource "google_cloud_run_v2_service" "default" {
146146
value = local.nextauth_url
147147
}
148148
startup_probe {
149-
initial_delay_seconds = 0
150-
timeout_seconds = 1
151-
period_seconds = 3
152-
failure_threshold = 1
149+
initial_delay_seconds = 45
150+
timeout_seconds = 65
151+
period_seconds = 5
152+
failure_threshold = 5
153153
tcp_socket {
154154
port = 8080
155155
}
@@ -183,6 +183,9 @@ resource "google_cloud_run_service_iam_policy" "noauth" {
183183
service = google_cloud_run_v2_service.default.name
184184

185185
policy_data = data.google_iam_policy.noauth.policy_data
186+
depends_on = [
187+
time_sleep.cloud_run_v2_service
188+
]
186189
}
187190

188191
resource "google_compute_region_network_endpoint_group" "default" {
@@ -194,7 +197,8 @@ resource "google_compute_region_network_endpoint_group" "default" {
194197
service = google_cloud_run_v2_service.default.name
195198
}
196199
depends_on = [
197-
time_sleep.project_services
200+
time_sleep.project_services,
201+
time_sleep.cloud_run_v2_service
198202
]
199203
}
200204

@@ -220,6 +224,9 @@ resource "google_compute_url_map" "default" {
220224
service = google_compute_backend_bucket.default.id
221225
}
222226
}
227+
depends_on = [
228+
time_sleep.cloud_run_v2_service
229+
]
223230
}
224231

225232
resource "google_compute_backend_service" "default" {

0 commit comments

Comments
 (0)