-
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
google_compute_instance with user-managed service account and empty scopes list results in no SA assignment #13807
google_compute_instance with user-managed service account and empty scopes list results in no SA assignment #13807
Comments
The issue: serviceAccount is missing in the playload when scope is empty.
|
@edwardmedia i wasn't able to find the time to fix this last week. Removing assignment |
I checked and can confirm this is still an issue. Here's a config to reproduce:
This results in a create request like:
Looking at expandServiceAccounts it doesn't seem like we're doing anything unusual here, so my guess is that this might be a behavior of the Go client library for compute, which is ultimately responsible for the |
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. |
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
1.3.9, 1.3.1 also
Affected Resource(s)
google_compute_instance
Terraform Configuration Files
Expected Behavior
The same cli command with an empty scope and a user-managed SA provided results in the VM being created with the SA you've specified assigned, and no scopes set, as expected.
This command, for example, results in the expected behavior.
The resultant SA and assignment by this cli command creation is:
Actual Behavior
The VM is created with no service account and no scopes. This is the same behavior as if you had picked "No Service Account" and no Scopes in the UX.
Steps to Reproduce
email = my-service@[projectid].iam.gserviceaccount.com
andscopes = []
in theservice_account
block.terraform apply
Important Factoids
scopes itself is a required field (as a construct of how it was it was implemented in the provider, not GCP itself) but there is no validation for the plan checking on the count > 1 or similar.
References
b/317497258
The text was updated successfully, but these errors were encountered: