-
Notifications
You must be signed in to change notification settings - Fork 131
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
Unable to retrieve schemas - Backend authentication failure #142
Comments
Hi @tonyghita FWIW though we are still working out what the ideal UX be around these cases. The tricky thing is getting VSCode (or any GUI app really) to read the appropriate environment variable and then once you do that you need to realize that it will propagate those variables down to all instances of the LS which may be instances serving many different workspaces/folders. Therefore it's actually desirable for the LS to somehow re-read any workspace/folder-specific variables, which it doesn't do currently. I can see you are already aware of this challenge if you use In the meantime there is a few workarounds:
|
Hey @radeksimko, thanks for the speedy response. I've tried installing the latest language server via VS Code, but I no longer see the option for terraform-ls in the Output tab so I'm not quite sure where it is. I'm also not sure where to see if the language server is enabled or disabled. 🤔 The wrapper script is an interesting idea—I'll look into the Is there any documentation available for which configuration settings are possible for terraform-ls within VS Code? What would be the best way to discover those. |
I was able to install 0.3.2, but ran into an issue I don't understand as soon as the language server starts.
|
@tonyghita Assuming you're on macOS Catalina, then I believe this is a bug I described in hashicorp/vscode-terraform#341 which Audrey fixed recently in hashicorp/vscode-terraform#343 (released as part of Can you try installing the latest rc from here? https://github.com/hashicorp/vscode-terraform/releases
The best way to discover these for now would be executing |
I'm on macOS Mojave—the Thank you for the helpful responses 👍 |
I posted this in a related issue, but just for anyone viewing, a workaround to explicitly set environment for Terraform can be achieved by writing a custom script to run Terraform with those env vars and passing it as the Terraform executable: https://github.com/hashicorp/vscode-terraform/wiki/Manually-Setting-the-Terraform-Executable-Path That being said, backend authentication should NOT be required for schema, so we are going to see how we can solve this within the LS. |
Going to merge this with #128 to consolidate backend authentication issues. |
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. |
Hi team! I'm super excited about the v2.0.0 release, so I went ahead and installed v2.0.0.rc.1.
I noticed that the
terraform-ls
language server exits with status code 1 in my project.My terraform remote state is kept in AWS S3, and typically I use the
AWS_PROFILE
environment variable to specify which set of credentials to use.For convenience, I've setup and
.envrc
file that automatically sets the correctAWS_PROFILE
value based on the directory I'm in.I think the issue is that the language server has no idea about
AWS_PROFILE
. I'm wondering whether:terraform-ls
viavscode-terraform
to pass the correct AWS credential sourceThanks for reading this!
The text was updated successfully, but these errors were encountered: