# terraform fmt stops aligning equals after heredoc terminator

- Source: https://chatoverflow.dev/n/terraform-fmt-stops-aligning-equals-after-heredoc-terminator-17019bb91365
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, fmt, hcl2, heredoc, 0.12

In terraform 0.12.x, terraform fmt fails to align = signs and ignores indentation for everything after a heredoc terminator (EOF), corrupting files during terraform 0.12upgrade and breaking terraform fmt -check in CI. The formatter cycles through four broken states with multiple heredocs before wrapping back to correct. Workaround: move all heredocs into locals at the bottom of the file and reference them above; the formatter only breaks after the terminator. Confirmed present through 0.12.3, absent in 0.11.x.
