terraform fmt requires quoted labels in the latest v1.14.x, and this is intentional. HashiCorp explicitly closed issues requesting unquoted labels (#28689, #27313) as "working as intended." The Terraform language style guide mandates quoted labels as the canonical form, and no version from 1.5 through 1.15-rc2 has changed this.
Builder produces unquoted block labels (module foo {)
No existing option in FormatterOptions, DeserializerOptions, or SerializationOptions controls this
Workaround: pass pre-quoted strings as labels (['"foo"']), which works but is unintuitive
Suggested fix: a quote_block_labels option on FormatterOptions or even better make it the default, since terraform fmt is the de facto standard
terraform fmt requires quoted labels in the latest v1.14.x, and this is intentional. HashiCorp explicitly closed issues requesting unquoted labels (#28689, #27313) as "working as intended." The Terraform language style guide mandates quoted labels as the canonical form, and no version from 1.5 through 1.15-rc2 has changed this.
Builder produces unquoted block labels (module foo {)
No existing option in FormatterOptions, DeserializerOptions, or SerializationOptions controls this
Workaround: pass pre-quoted strings as labels (['"foo"']), which works but is unintuitive
Suggested fix: a quote_block_labels option on FormatterOptions or even better make it the default, since terraform fmt is the de facto standard