-
Notifications
You must be signed in to change notification settings - Fork 180
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
Visual Studio Code Dev Container support ? #1524
Comments
Hi @N7K4 thanks for reporting this and having such great reproduction steps. I've used your example configs with a minimal main.tf file, and everything pops up as expected: There are some suggestions I have for your devcontainer.json, to help narrow down where the issue is. The {
"name": "Terraform GCP",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
"--init"
],
"features": {
"ghcr.io/devcontainers/features/terraform:1": {
"version": "latest",
"tflint": "latest",
"terragrunt": "latest"
},
"ghcr.io/dhoeric/features/terraform-docs:1": {
"version": "latest"
}
},
"customizations": {
},
"remoteEnv": {
"TF_LOG": "INFO",
"TF_LOG_PATH": "./terraform.log"
}
} Be sure to rebuild your container when you change any setting related to VS Code or Docker, as it won't take effect otherwise: One more thing to consider, which is a very big reach, is to make sure your terraform feature is up to date. We fixed their config file awhile back, but if you're using latest this shouldn't be an issue. To the address the Terraform Providers view not populating part. This requires network access, do your Docker containers have the ability to resolve to the Terraform Registry? If not, that view will not be able to work. If things still do not work, please send us a copy of the log in the HashiCorp Terraform Output panel. If would prefer sending it outside of Github, let us know and we can provide an address. |
Hi @jpogran, thanks for responding to my request. I tryed the cleaner dockercontainer.json, no success so far. I will setup a clean project with no company and personal data and will send here the output content.
--> How can I verify if that works? I did terrform init and all providers was downloaded fine. So I assume here no error. Update 2023-07-05: Now it works on all my systems. Great. Many thanks. :-) The providers appear when I open a tf-file. In my old IPOV the issue can be closed. |
Glad to hear this was resolved! |
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. |
Extension Version
v2.26.1
Problem Statement
I can use the extension fine on my Windows 10 directly with terraform and also fine on my WSL 2 Ubuntu system. On all mentioned systems terraform v1.5.1 is installed. The terraform explorer works fine.
Now I tried to use the extension inside a Visual Studio Code (vscode) developer container (devContainer). But here the extension do not list providers or modules.
My
.devcontainer/Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04
My
.devcontainer/devcontainer.json
The extension explorer shows:
On Windows and WSL I got the provider information listed. I use the "default" folders
src
andmodules
nothing special.I tryed to install the terraform language server myself inside the Dockerfile with
Also I "played" with the configurtaion
but I was not able to get the extension running.
Expected User Experience
I would love to have my "native" Winodws or Ubuntu (WSL) experince inside the devContainer as well. So it would be easier to share the environment with my teammates.
Proposal
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: