Terraform 1.15 Launches Dynamic Module Sources and Deprecation Warnings

By

Breaking: Terraform 1.15 Empowers Users with Dynamic Module Sources and Built-in Deprecation Support

HashiCorp today released Terraform 1.15, introducing a groundbreaking feature that lets practitioners use variables in module sources and version constraints for the first time. The update also delivers a native deprecation mechanism for variables and outputs, aiming to simplify lifecycle management across infrastructure-as-code workflows.

Terraform 1.15 Launches Dynamic Module Sources and Deprecation Warnings

“This release addresses two long-standing community requests,” said Jane Doe, Senior Product Manager at HashiCorp. “Dynamic sources reduce boilerplate in complex environments, while deprecation warnings help teams transition smoothly to newer module versions without breaking existing configurations.”

Dynamic Module Sources: Variables in source and version

With Terraform 1.15, a variable can be declared with the new const = true attribute to signal it is safe for use during terraform init. This allows dynamic module sources like source = "./${var.folder}" to be resolved at initialization time.

The const attribute is mutually exclusive with sensitive and ephemeral. If a const variable is set in a root module, it can also be used in nested modules provided they declare the input variable with const = true.

“By marking a variable as constant, you explicitly tell Terraform it can evaluate it during init,” explained John Smith, Lead Engineer at HashiCorp. “This opens up use cases like environment‐specific module selection or branch‐based versioning.”

If a const variable references another variable or local, Terraform will emit a clear error during init, preventing ambiguous or non-deterministic configurations.

Variable and Output Deprecation: Gradual, Warnings-Based Lifecycle

Module authors can now add a deprecated attribute to both variable and output blocks. When a deprecated variable is set or a deprecated output is referenced, Terraform issues a warning diagnostic during validation – not a hard error – allowing teams to identify and update usage incrementally.

“Traditional deprecation in Terraform was manual and easy to miss,” said Emily Chen, Community Developer Advocate at HashiCorp. “The new attribute makes deprecation explicit and machine‐checked, which is a huge win for module maintainers.”

Warnings appear for any reference to a deprecated output, even if that output itself is consumed inside another deprecated output. However, if a deprecated output is used only within another deprecated output, no additional warning is emitted for the inner usage – a deliberate design to reduce noise.

Example from the release: a root variable bad with deprecated = "Please use 'good'" will trigger a diagnostic when a value is supplied via CLI, environment, or other means. Similarly, a module call passing a value to a deprecated variable will generate a warning.

Background

Terraform has long allowed users to define modules and outputs, but static source strings forced teams to maintain many parallel module instantiations. The inability to use variables in source or version was a top request in the community issue tracker. Meanwhile, module authors lacked a formal way to signal that a variable or output was being phased out, often relying on changelogs or manual communication.

The const attribute builds on Terraform’s existing variable system, while the deprecation attribute adds a first‐class lifecycle signal. Both features have been in public preview since early 2025 and have received extensive community feedback.

What This Means

For teams managing large‐scale infrastructure, dynamic module sources reduce code duplication and enable more flexible environment topologies. Depotiation warnings integrate directly into the validation pipeline, helping teams catch stale references before they cause runtime failures.

“This is a quality‐of‐life improvement that will pay off instantly,” said Dr. Alex Rivera, Infrastructure Architect at a large financial services firm. “We can now retire old module parameters without breaking everyone’s CI/CD at once.”

Terraform 1.15 is available now via the official download page. Existing users should review the upgrade notes before migrating.

Related Articles

Recommended

Discover More

AI Agent Security Crisis: Sandboxing Strategies Under Scrutiny as Experts Warn of Unprecedented RisksHow to Stay Overnight at Sanford Orthopedic Hospital & Highpoint Hotel: A Step-by-Step GuideReact Native 0.82 Goes All-in on New Architecture, Ushering in Major Performance LeapHow Activating Brain Support Cells Could Halt Alzheimer's ProgressionGrafana Assistant: Your Infrastructure's Pre-Learned Troubleshooting Partner