tfsort

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

tfsort

Logo

tfsort is a command-line utility that sorts Terraform variables and outputs in a .tf file.

Installation

To install tfsort, you can download the latest binary release from the releases page. Alternatively, you can build from source by cloning the repository and running go build.

Usage

The basic usage of tfsort is as follows:

tfsort --file <path-to-tf-file> [--out <path-to-output-file>] [--dry-run]

Available flags:

  • --file: the path to the .tf file you want to sort. This flag is optional.
  • --out: the path to the output file. If not provided, tfsort will overwrite the input file.
  • --dry-run: preview the changes without altering the original file.

Examples

Here's an example of using tfsort to sort a Terraform file called main.tf:

tfsort variables.tf

This will sort the resources in variables.tf in place. You can also use the --out flag to specify an output file:

tfsort --file variables.tf --out sorted.tf

This will create a new file called sorted.tf with the sorted resources.

Author

This project was created by Alexander Nabokikh.

License

This software is available under the following licenses:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL