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

Include subfolders as part of the current work directory #30558

Closed
divad1196 opened this issue Feb 18, 2022 · 3 comments
Closed

Include subfolders as part of the current work directory #30558

divad1196 opened this issue Feb 18, 2022 · 3 comments
Labels
enhancement new new issue not yet triaged

Comments

@divad1196
Copy link

Hi,
first, thank you for the work on terraform, and sorry if an issue is/was already open, I couldn't find one mentioning this

Current Terraform Version

Terraform v1.1.6 on linux_amd64

Use-cases

We have different machine with different purpose with the same providor. I would like to organize them within subfolders without having to repeat many declaration. It would work just as-if the files were in the root folder.

Attempted Solutions

I tried the following 2 solutions, which are the only ones I could find after hours of research.

  • Use modules: This is not great since I have to define the required provider, and I cannot refer resources from other folders.
  • Terragrunt: promising, but this is still another program for this mere usage.

Proposal

I understand that recursive import would be good. So I thought that we could have an "include" key word, similar to "module" key word, that would take a path to a folder or file and consider its contents as part of the current folder.
If folder B includes folder C, and folder A includes folder B, then folder C would be included in A as well.

The content would be included just once. If a source is referenced many time, either ignore it or put a warning/error.

References

I couldn't find any issue on github, but I found many forums with the same concern that I have.

Thank you for your time

@divad1196 divad1196 added enhancement new new issue not yet triaged labels Feb 18, 2022
@crw
Copy link
Collaborator

crw commented Feb 18, 2022

@divad1196 This looks to be a contender for a previous issue on the same topic: #23047 -- what do you think? If it seems to be the same, can we close this one?

@divad1196
Copy link
Author

@crw I think you are right. The syntax does not really matter, I would just say that we may want to include a single file and not only folders of file, so "folder" key word wouldn't suits well.
So, sorry for not having found it by myself before posting, I think the reason is that the issue you mentioned is idle for more than 2 years.
I will continue on this topic, hoping that something will come out of this.
Thank you and have a nice day.

@github-actions
Copy link

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 details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants