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
- hashicorp/terraform release v0.12.14 (accessed 2026-10-31)
- Terraform 0.15 upgrade guide: legacy configuration language features (accessed 2026-10-31)
- Terraform 0.12 upgrade guide: first-class expressions (accessed 2026-10-31)
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
- Replace the quoted interpolation with its expression. Change
value = "${var.name}"tovalue = var.name, keeping the expression exactly as written inside the interpolation. - 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.
Related
Same ecosystem
- AKS 1.28 and earlier are no longer supported
- AKS 1.29 is past long-term support
- AKS 1.30 is past long-term support
- AKS 1.31 is past its 12-month support window
- AKS 1.32 is past its 12-month support window
- AKS 1.33 is past its 12-month support window
- Terraform CLI 1.10 is no longer a supported release line
- Terraform CLI 1.11 is no longer a supported release line
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