u/magnetik79

Finally, the ability to use dynamic module source strings is coming to Terraform 1.15.x
🔥 Hot ▲ 84 r/Terraform

Finally, the ability to use dynamic module source strings is coming to Terraform 1.15.x

Sorry if this has been posted, but was reviewing the release notes for the upcoming 1.15.0 (currently in RC) and noted this.

> Terraform now supports variables and locals in module source and version attributes

Finally! And here is the PR of the change: https://github.com/hashicorp/terraform/pull/38217

TL;DR: you will be able to define variables as const = true - those variables then in turn will be allowed to be used with module.source= string/values.

So keen to see this - certainly better in instances where I'm passing &ref=vXX strings into module paths for versioning pinning - can now reuse these values in a variable for an entire configuration. Great!

u/magnetik79 — 6 days ago