Skip to content
Evergreen Evergreen
Documentation

Interpolation-only strings are deprecated

Deprecated. The source gives no day. Replacement: The same expression without the surrounding quotes, such as var.name. Source: hashicorp/terraform release v0.12.14.

Check a version:

evergreen check pkg:generic/terraform

Terraform v0.12.14 deprecated a string whose whole value is one interpolation, such as “${var.name}”: the same value is written as the bare expression var.name. Terraform still accepts the quoted form but recommends the bare expression for readability, and terraform fmt repairs simple examples. A string that mixes text with an interpolation, such as “prefix-${var.name}”, is not the deprecated form and still needs its quotes.

Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>

   
Status Deprecated
Severity low
Ecosystem terraform
Component pkg:generic/terraform
Affected versions vers:semver/>=0.12.14
Date from the source The source gives no day
Replacement The same expression without the surrounding quotes, such as var.name
Evidence last seen 2026-10-31
Reviewed 2026-10-31 by arminazimi
Review due 2027-01-29 (90 days after the last review)
Rule ID terraform.syntax.interpolation-only

Sources

Migration

Constraints

  • Rewrite only a string whose entire value is one ${ … } interpolation. A string with any literal text, a %{ … } directive, or an escape sequence must keep its quotes.
  • Do not remove the quotes from an object key or a block label: those strings are not expressions, and the bare form would not be valid HCL.
  • Each rewrite is a syntactic one-to-one change with the same expression inside the interpolation, so plan output should not change.

Steps

  1. Replace the quoted interpolation with its expression. Change value = "${var.name}" to value = var.name, keeping the expression exactly as written inside the interpolation.
  2. Repair the other interpolation-only strings. Repeat for every string in *.tf that contains exactly one interpolation and no other text. Run terraform fmt to catch simple examples the codemod did not rewrite.

Verification

  • terraform init -backend=false && terraform validate: Initialize without touching remote state and check that the rewritten expressions are valid HCL.
  • terraform plan: Confirm the rewrite evaluates to the same values and the plan is unchanged.

Detected by

The terraform detector. See Detectors and Compatibility.

Same ecosystem

Data

This page is generated from registry/terraform.json, rule terraform.syntax.interpolation-only, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.

Last updated