Skip to content

Commit 9d1b9de

Browse files
committed
fix(iam-admin): add 90s warmup delay to prevent service account creation race condition
1 parent edeb4ad commit 9d1b9de

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

java-iam-admin/.cloud/main.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ resource "google_project_service" "iam" {
1111
count = var.inputs.should_enable_apis_on_apply ? 1 : 0
1212
disable_on_destroy = var.inputs.should_disable_apis_on_destroy
1313
}
14+
resource "time_sleep" "for_90s_allowIamToFullyEnable" {
15+
depends_on = [google_project_service.iam]
16+
create_duration = "90s"
17+
}
1418
resource "random_id" "id" {
1519
byte_length = 3
1620
}
@@ -20,5 +24,5 @@ locals {
2024
resource "google_service_account" "service_account" {
2125
account_id = local.service_account_id
2226
display_name = "Service Account"
23-
depends_on = [google_project_service.iam]
27+
depends_on = [time_sleep.for_90s_allowIamToFullyEnable]
2428
}

0 commit comments

Comments
 (0)