Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform fmt should accept .tfbackend files #36564

Open
thiagowfx opened this issue Feb 21, 2025 · 0 comments
Open

terraform fmt should accept .tfbackend files #36564

thiagowfx opened this issue Feb 21, 2025 · 0 comments
Labels
enhancement new new issue not yet triaged

Comments

@thiagowfx
Copy link

Terraform Version

% terraform version
Terraform v1.10.4

Use Cases

It should be possible to run terraform fmt on .tfbackend files, just like it is possible to do so in .tfvars files.

As of now:

$ terraform fmt a.tfbackend
│ Error: Only .tf, .tfvars, and .tftest.hcl files can be processed with terraform fmt

Wherein:

$ cat a.tfbackend
a = "foo"
b      = "bar"

.tfbackend is very similar to .tfvars as per the official docs.

The example docs also show the files nicely formatted (the equal signs are vertically aligned), suggesting that it is the intent.

Attempted Solutions

terraform fmt a.tfbackend does not work.

Renaming it to a.tfvars and then running terraform fmt a.tfvars works.

Proposal

Make terraform fmt accept *.tfbackend files, similarly to .tfvars.

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

1 participant