-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Problem using WIF authentication with google terraform provider #89
Comments
Per https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#authentication, the provider supports discovery and authentication via WIF, but it looks like it might not be supported for authenticating to the remote state endpoint. I think this is a Terraform issue, since we are correctly exporting |
Ok, I can move this to the google terraform provider repo. Thank you. |
@jketcham Remote state is part of terraform core, not the provider and I found an open issue hashicorp/terraform#29656 |
Ahhh there it is, thanks for the info @bharathkkb |
FYI for those running into this issue, one way around it is to generate an access token and then do: Terraform will then use the access token to auth instead of the credentials file: https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#access_token |
TL;DR
I'm not sure if this is an issue with the
auth
action or with the google terraform provider (or something else), so apologies if this is not the correct place.When I use the
auth
action to setup WIF authentication to google cloud so I can run terraform, I get this error immediately as terraform tries to initialize the backend (with state stored in Cloud Storage):This should be reproducible with the given GitHub Actions YAML below and any terraform config that uses Cloud Storage as it's state backend.
A quick search turned up these issues that also dealt with WIF and experienced this
unknown credential type: "external_account"
error:Expected behavior
Terraform is able to initialize module directory without error.
Observed behavior
Terraform returns error when initializing module directory.
Action YAML
Additional information
I have WIF setup with the following terraform config I've already applied locally (and this is the same terraform config that the workflow is trying to init):
This issue builds off my comment here: google-github-actions/setup-gcloud#440 (comment)
Thanks!
The text was updated successfully, but these errors were encountered: