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

Allow variables in module's source field #26619

Closed
iloveicedgreentea opened this issue Oct 17, 2020 · 2 comments
Closed

Allow variables in module's source field #26619

iloveicedgreentea opened this issue Oct 17, 2020 · 2 comments
Labels
enhancement new new issue not yet triaged

Comments

@iloveicedgreentea
Copy link

Current Terraform Version

Terraform v0.13.4

Use-cases

Using separate modules but all having the same variables. I can make a map variable with the key of each module name and then only have one module resource instead of one per module. I want the source field to be able to use each.key so I can programmatically generate the module source from the variable key e.g. each.key == "module1" so "./modules/${each.key}" would become ./modules/module1

Proposal

module "function" {
  for_each = var.enabled_modules
  source   = "./modules/${each.key}"
@iloveicedgreentea iloveicedgreentea added enhancement new new issue not yet triaged labels Oct 17, 2020
@pkolyvas
Copy link
Contributor

I'm going to close this as a duplicate of #25587.

@ghost
Copy link

ghost commented Nov 20, 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 details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 20, 2020
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