-
Notifications
You must be signed in to change notification settings - Fork 1.8k
google_service_account_key broken in 1.14.0 - regression bug #1655
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
Comments
Confirmed by me. |
I believe I broke this in commit 8f31fec, The functionality I added is the same as the previous, but I first try and get the project and I was unaware that I think this can either safely be reverted, or don't error if I am not sure what is the best solution? |
Commit 8f31fec introduced a bug for the 'service_account_key' resource where it required a project be set either in the provider or in the resource for 'service_account_key', but a project isn't required if the service account is a service account fully qualified name or a service account email. This PR relaxes the requirement that a project needs to be set for the 'service_account_key' resource, 'service_account' datasource and 'service_account_key' datasource, but will error if we try to build a fully qualified name from a service account id when no project can be found. This also cleans up 'serviceAccountFQN' so it is slightly easier to follow and return an error if there is no project but we need one to build the service account fully qualified name. Fixes: hashicorp#1655
@danawillow I have what I believe to be a fix to this issue I casued here, but if that looks to be too much effort (or not comfortable with the change) I can revert the original change completely and submit a PR with the reverted change? |
Cool! I was planning on fixing this today but I'm happy to review a PR instead if you have one. |
I have created the following PR #1664 :) |
Commit 8f31fec introduced a bug for the 'service_account_key' resource where it required a project be set either in the provider or in the resource for 'service_account_key', but a project isn't required if the service account is a service account fully qualified name or a service account email. This PR relaxes the requirement that a project needs to be set for the 'service_account_key' resource, 'service_account' datasource and 'service_account_key' datasource, but will error if we try to build a fully qualified name from a service account id when no project can be found. This also cleans up 'serviceAccountFQN' so it is slightly easier to follow and return an error if there is no project but we need one to build the service account fully qualified name. Fixes: hashicorp#1655
Commit 8f31fec introduced a bug for the 'service_account_key' resource where it required a project be set either in the provider or in the resource for 'service_account_key', but a project isn't required if the service account is a service account fully qualified name or a service account email. This PR relaxes the requirement that a project needs to be set for the 'service_account_key' resource, 'service_account' datasource and 'service_account_key' datasource, but will error if we try to build a fully qualified name from a service account id when no project can be found. This also cleans up 'serviceAccountFQN' so it is slightly easier to follow and return an error if there is no project but we need one to build the service account fully qualified name. Fixes: hashicorp#1655
Commit 8f31fec introduced a bug for the 'service_account_key' resource where it required a project be set either in the provider or in the resource for 'service_account_key', but a project isn't required if the service account is a service account fully qualified name or a service account email. This PR relaxes the requirement that a project needs to be set for the 'service_account_key' resource, 'service_account' datasource and 'service_account_key' datasource, but will error if we try to build a fully qualified name from a service account id when no project can be found. This also cleans up 'serviceAccountFQN' so it is slightly easier to follow and return an error if there is no project but we need one to build the service account fully qualified name. Fixes: #1655
@vishen @danawillow is this merged in any release ? I am still hitting the same issue for any provider > 1.13 ( including current 1.16.2 ) even if i can see it in the changelog for version 1.15 |
@primeroz I just checked and it works for |
@vishen i tried rerunning the example i put in the case when i created and that works. I am having the issue with a "real" configuration, there must be something different i can't see yet , i will see to reproduce it and understand what is causing it. |
FYI my issue was that i was using "unique_id" rather than "id" in the service_account_id parameter
what's strange is that i was getting the very same error, that's why i thought it was not merged
|
FYI @primeroz I'd highly recommend not depending on the resource id. We purposely don't put any information about them in the documentation because we want to be able to change how we store them at any moment. For service accounts specifically, you should be able to use 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. 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! |
Hi there,
In version 1.14.0 there seems to be a regression bug where the google_service_account_key resource does not work anymore.
According to the docs the resource does not expect a key for project. It is , i assume, going to inherit it from the keyring it belongs to
Starting in version 1.14.0 there seem to be a validation error during apply
If i don't have a project key specified in the resource i get:
If i do add the project to the resource i get a vlidation error during plan
In version 1.13.0 this work as expected.
Interesting enough if i add the project key to the provider it then works also in version 1.14.0
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://paste.debian.net/hidden/def5b763/
Expected Behavior
google_service_account_key is created
Actual Behavior
Terraform fails to run
Steps to Reproduce
terraform init
3.
terraform apply -var project_id=YOURPROJECT -var region=europe-west1
Important Factoids
References
The text was updated successfully, but these errors were encountered: