Skip to content

Commit 96390cc

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

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ 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+
count = var.inputs.should_enable_apis_on_apply ? 1 : 0
16+
depends_on = [google_project_service.iam]
17+
create_duration = "90s"
18+
}
1419
resource "random_id" "id" {
1520
byte_length = 3
1621
}
@@ -20,5 +25,5 @@ locals {
2025
resource "google_service_account" "service_account" {
2126
account_id = local.service_account_id
2227
display_name = "Service Account"
23-
depends_on = [google_project_service.iam]
28+
depends_on = [time_sleep.for_90s_allowIamToFullyEnable]
2429
}

0 commit comments

Comments
 (0)