-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Comments
You can still format a file regardless of its name by piping its contents into
Bear in mind though that the file format is based on the earlier generation of HCL (1) and so there is no guarantee that it would always produce compatible output or be able to format it. |
@radeksimko While this hint makes sense, it seems to be sort of natural for
Though looking at the conversation in #36570 I seem to think implementation isn't going to be an easy thing =(
|
Looking at bb86860 from 2021, this looks to be a long-existed feature which I have never come across, though which was described to be using |
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again! |
Terraform Version
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:
Wherein:
.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 runningterraform fmt a.tfvars
works.Proposal
Make
terraform fmt
accept*.tfbackend
files, similarly to.tfvars
.References
No response
The text was updated successfully, but these errors were encountered: