Difference between revisions of "Terraform fmt --help"
Jump to navigation
Jump to search
(Created page with "{{lc}} == See also == * {{terraform fmt}} Category:Terraform") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
+ | [[terraform fmt]] --help | ||
+ | |||
+ | Usage: terraform [global options] fmt [options] [target...] | ||
+ | |||
+ | Rewrites all Terraform configuration files to a canonical format. All | ||
+ | configuration files ([[.tf]]), variables files ([[.tfvars]]), and testing files | ||
+ | (.tftest.hcl) are updated. JSON files ([[.tf.json]], [[.tfvars.json]], or | ||
+ | .tftest.json) are not modified. | ||
+ | |||
+ | By default, fmt scans the current directory for configuration files. If you | ||
+ | provide a directory for the target argument, then fmt will scan that | ||
+ | directory instead. If you provide a file, then fmt will process just that | ||
+ | file. If you provide a single dash ("-"), then fmt will read from standard | ||
+ | input (STDIN). | ||
+ | |||
+ | The content must be in the Terraform language native syntax; JSON is not | ||
+ | supported. | ||
+ | </pre> | ||
+ | Options: | ||
+ | |||
+ | -list=false Don't list files whose formatting differs | ||
+ | (always disabled if using STDIN) | ||
+ | |||
+ | -write=false Don't write to source files | ||
+ | (always disabled if using STDIN or -check) | ||
+ | |||
+ | -diff Display diffs of formatting changes | ||
+ | |||
+ | -check Check if the input is formatted. Exit status will be 0 if all | ||
+ | input is properly formatted and non-zero otherwise. | ||
+ | |||
+ | -no-color If specified, output won't contain any color. | ||
+ | |||
+ | -recursive Also process files in subdirectories. By default, only the | ||
+ | given directory (or current directory) is processed. | ||
+ | |||
+ | </pre> | ||
Latest revision as of 12:25, 20 December 2023
terraform fmt --help
Usage: terraform [global options] fmt [options] [target...] Rewrites all Terraform configuration files to a canonical format. All configuration files (.tf), variables files (.tfvars), and testing files (.tftest.hcl) are updated. JSON files (.tf.json, .tfvars.json, or .tftest.json) are not modified. By default, fmt scans the current directory for configuration files. If you provide a directory for the target argument, then fmt will scan that directory instead. If you provide a file, then fmt will process just that file. If you provide a single dash ("-"), then fmt will read from standard input (STDIN). The content must be in the Terraform language native syntax; JSON is not supported.
Options:
-list=false Don't list files whose formatting differs (always disabled if using STDIN)
-write=false Don't write to source files (always disabled if using STDIN or -check)
-diff Display diffs of formatting changes
-check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.
-no-color If specified, output won't contain any color.
-recursive Also process files in subdirectories. By default, only the given directory (or current directory) is processed.
See also[edit]
terraform fmt [ -diff | -check | validate | --help ]
Advertising: