-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 resource gets created but not added to state #6362
Service Account resource gets created but not added to state #6362
Comments
@MorganPeat your provider version is pretty old. Can you try to upgrade and see if this still happens |
I'm having similar issues with the latest provider version |
Sadly, no. We have a large number of sentinel policies and other work to do before we can move to terraform 0.12. But, looking at the code in the link above, nothing much seems to have changed. If there is a delay on the GCP side then the issue would occur even with a newer provider version? |
@MorganPeat I have tried running your code by creating the SA along with 12 roles on both terraform 0.11 and 0.12, still not able to catch that error. |
Hi @MorganPeat, this looks very similar to #6377, but the key factor described there is project creation. Is this your scenario as well? If so, there is a workaround I posted there that may help you even in |
Thanks @c2thorn that issue does look exactly like the one we are having. (Ours is on new project creation too). |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.11.14
Affected Resource(s)
google_service_account
Terraform Configuration Files
Debug Output
https://gist.github.com/MorganPeat/b8fca25b2845e0b93dd8e4bd2c441c96
Expected Behavior
Service account is created, email address is populated so dependent resources can refer to it.
Actual Behavior
Service account is created but not added to terraform state. Dependent resources not created. Repeated
terraform apply
fails because underlying SA is created in GCP. Must either delete SA via GCP console or runterraform import
to continue.Steps to Reproduce
Intermittent, sadly. Not easy to reproduce.
Important Factoids
There is a hard-coded 1 second sleep after the SA is created, after which the SA detail is read back. It appears (looking at the debug output in the attached gist) that the SA was not GET-able after this time. Subsequent
terraform apply
s were able to GET the resource.References
https://github.com/terraform-providers/terraform-provider-google/blob/master/google/resource_google_service_account.go#L86
The text was updated successfully, but these errors were encountered: