Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service account: Provider produced inconsistent result after apply #2141

Closed
flozzone opened this issue Oct 17, 2024 · 0 comments · Fixed by #2142
Closed

Service account: Provider produced inconsistent result after apply #2141

flozzone opened this issue Oct 17, 2024 · 0 comments · Fixed by #2142
Labels
bug Something isn't working

Comments

@flozzone
Copy link
Contributor

TL;DR

Sometimes creating GCP service accounts can fail with Terraform due to GCPs eventual consistency model (See terraform-provider-google#18087).
After running apply again, it fails because the service account already exists.

A possible workaround has been added to Terraform/google_service_account module to ignore an already existing service account by passing create_ignore_already_exists=true when creating the google_service_account

Expected behavior

Service account gets created or at least it would take an already existing one if running apply again

Observed behavior

Terraform complains about an already existing GCP service account

Terraform Configuration

module "app_workload_identity" {
  source              = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
  name                = "some-sa-name"
  namespace           = "some-ns"
  project_id          = "some-project"
  roles               = []
}

Terraform Version

Terraform v1.8.4
on linux_amd64

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant