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

Add ability to explicitly specify root modules as a workspace setting #396

Closed
paultyng opened this issue Jun 16, 2020 · 1 comment · Fixed by #423
Closed

Add ability to explicitly specify root modules as a workspace setting #396

paultyng opened this issue Jun 16, 2020 · 1 comment · Fixed by #423
Labels
enhancement New feature or request

Comments

@paultyng
Copy link
Contributor

paultyng commented Jun 16, 2020

Users' should be able to manually override root modules for a given Terraform workspace or folder. The config should be scoped resource.

"terraform.rootModules": [
  "dir1",
  "dir2/dir3",
  "otherDir"
]

The paths should be relative to the root of the folders in the workspace (not sure if we want to allow for initialization outside workspace scope, maybe as a follow-on issue to investigate).

Given the above config and the following tree structure for a single workspace folder:

.
├── dir1
│   └── main.tf 
├── someDir
│       └── main.tf 
└── dir2
    ├── notRoot
    └── dir3
        └── main.tf 

The extension should enumerate all the directories in the setting that match actual directories present and pass those to the LS. In this case it would be:

[
  "dir1",
  "dir2/dir3"
]

(You'll notice otherDir is not passed as it doesn't match anything on disk, and someDir is not passed as its not in the settings).


Optionally we may also want to support per root module expanded configuration.

"terraform.rootModules": {
  "dir1": {
    "someSetting": ""
  }, 
  "dir2/dir3": {
    "someOtherSetting": ""
  }
}
@ghost
Copy link

ghost commented Aug 13, 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 Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants