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

Auth and other environment variables #154

Closed
JuanSeBestia opened this issue Jun 11, 2020 · 4 comments
Closed

Auth and other environment variables #154

JuanSeBestia opened this issue Jun 11, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@JuanSeBestia
Copy link

I use GOOGLE_APPLICATION_CREDENTIALS env variable to retrive all information of backend gcs, how to put this variable inside the server terraform-ls.

When it run, show error

2020/06/11 09:28:06 schema_storage.go:116: error obtaining schemas: Unable to retrieve schemas: failed to get schemas: terraform (pid 8829) exited (code 1): exit status 1
stdout: ""
stderr: "\x1b[31m\n\x1b[1m\x1b[31mError: \x1b[0m\x1b[0m\x1b[1mstorage.NewClient() failed: dialing: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.\x1b[0m\n\n\x1b[0m\x1b[0m\x1b[0m\n"
@paultyng
Copy link
Contributor

If the variable is supplied to the editor at startup, it should propagate through the LS. the LS is not invoked in an interactive shell, so it would not load any env vars loaded via that method.

I'm going to move this to the LS though, we have an issue there to avoid the need to auth to backends for schema (its not necessary in the protocol, just a limitation of how the schema command was implemented in the Terraform CLI).

@paultyng paultyng transferred this issue from hashicorp/vscode-terraform Jun 11, 2020
@paultyng
Copy link
Contributor

You can alternatively execute Terraform via a wrapper script, here are instructions how to do that as a workaround: https://github.com/hashicorp/vscode-terraform/wiki/Manually-Setting-the-Terraform-Executable-Path

@paultyng paultyng added the bug Something isn't working label Jun 11, 2020
@paultyng
Copy link
Contributor

I'm going to consolidate this with #142, they seem to be the same issue (with different backends) so would most likely be solved by the same fix.

@ghost
Copy link

ghost commented Jul 11, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants