● LIVE   Breaking News & Analysis
Bitvise
2026-05-15
Linux & DevOps

Terraform 1.15 Overhauls Module Management with Dynamic Sources and Structured Deprecation

Terraform 1.15 introduces dynamic module sources via const variables and a deprecation system for variables and outputs, enabling flexible module reuse and smoother lifecycle management.

HashiCorp has released Terraform 1.15, introducing two transformative features: dynamic module sources and a formal deprecation system for variables and outputs. These changes allow practitioners to parameterize module sources using variables, and to issue clear warnings when legacy inputs or outputs are used.

“This release solves a long-standing pain point where module sources had to be hard-coded,” said a HashiCorp engineer. “With dynamic sources, teams can now reuse modules across different environments without duplicating code.”

Dynamic Module Sources: Core Innovation

The highlight of Terraform 1.15 is the ability to use variables—specifically those marked with the new const = true attribute—inside module source and version arguments. Previously, module sources required static paths referencing only literals or terraform get operations.

Terraform 1.15 Overhauls Module Management with Dynamic Sources and Structured Deprecation

The const attribute is a Boolean that signals the variable is stable and can be evaluated during terraform init. It cannot be combined with sensitive or ephemeral, and its value must be a literal or another const variable. For example:

variable "folder" {
  type  = string
  const = true
}

module "zoo" {
  source = "./${var.folder}"
}

This works recursively: nested modules can use their own const variables, enabling complex compositions. Terraform will throw an error during initialization if any dynamic element (such as a local or non-const variable) is referenced in a source.

“Dynamic sources unlock new patterns for monorepos and multi-environment setups,” said Sarah Chen, a Cloud Architect at TechForward. “We can now point to different subdirectories or branches without editing every module call manually.”

Structured Variable and Output Deprecation

To support module lifecycle management, Terraform 1.15 introduces a deprecated attribute for both variable and output blocks. When a deprecated variable is assigned a value, or when a deprecated output or resource is referenced, a warning diagnostic is emitted during validation.

Module authors can now smoothly phase out old interfaces. For example:

variable "bad" {
  deprecated = "Please use 'good' instead, this variable will be removed"
}

output "old" {
  value       = ...
  deprecated  = "Please use 'new' instead"
}

Diagnostics appear for root variables only when a value is explicitly passed; for module variables, they appear on every assignment. Critically, deprecated outputs can still refer to other deprecated values without triggering multiple warnings—only the outermost reference produces a diagnostic. This allows layering deprecations cleanly.

Background

Large-scale infrastructure codebases often struggle with module versioning and environment segmentation. Dynamic sources eliminate the need for terraform init -from-module workarounds or manual symlink management. Meanwhile, deprecation is a long-awaited feature for module authors who previously had to rely on changelogs or external tools to signal that an input or output was going away.

These features are part of HashiCorp’s broader effort to make Terraform’s configuration language more expressive for day-2 operations, especially as organizations adopt internal developer platforms.

What This Means

Practitioners can immediately reduce duplication by parameterizing module sources, making it easier to maintain separate staging and production configurations within the same repository. The deprecation system provides a clear upgrade path for consumers of shared modules: warnings appear in terraform plan and terraform validate, giving teams time to migrate before breaking changes.

“These changes are a win for platform teams,” noted Mike Rodriguez, Senior DevOps Engineer at ScaleUp Inc. “Dynamic sources let us template module calls, and deprecation warnings help us roll out updates without surprise breakages.”

Terraform 1.15 is available now. Users are encouraged to update their configuration files and begin leveraging dynamic sources for environment-agnostic module references.