Skip to content

Commit 95cfd5e

Browse files
authored
fix(iam-admin): remove redundant IAM project service to prevent state conflict (#13016)
### Summary This PR addresses a Terraform state conflict in the `java-iam-admin` module's integration setup. Previously, both the root `.cloud` module and the `java-iam-admin` submodule were managing the `iam.googleapis.com` service activation on the same project. In Terraform, managing the exact same physical cloud resource in multiple places within the state tree causes resource conflicts/fighting. This conflict was the root cause of the transient `"Provider produced inconsistent result after apply"` failures during `terraform apply`. Since the root `.cloud` module already manages `iam.googleapis.com` and introduces a 1-minute warmup sleep before applying any submodules, `java-iam-admin` does **not** need to manage this API. This fix removes the redundant `google_project_service.iam` activation and its associated sleeps from the submodule, simplifying it to the minimum required resources to successfully and stably create the service account. ### Verification - Bypasses the state conflict entirely, resolving the integration test flakiness. - Removes the submodule delay entirely, making the `java-iam-admin` integration setup faster.
1 parent 293f18f commit 95cfd5e

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ terraform {
55
}
66
}
77
}
8-
resource "google_project_service" "iam" {
9-
service = "iam.googleapis.com"
10-
project = var.inputs.project_id
11-
count = var.inputs.should_enable_apis_on_apply ? 1 : 0
12-
disable_on_destroy = var.inputs.should_disable_apis_on_destroy
13-
}
148
resource "random_id" "id" {
159
byte_length = 3
1610
}
@@ -20,5 +14,4 @@ locals {
2014
resource "google_service_account" "service_account" {
2115
account_id = local.service_account_id
2216
display_name = "Service Account"
23-
depends_on = [google_project_service.iam]
2417
}

0 commit comments

Comments
 (0)