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

Document the tfstacks fmt command #36202

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions website/docs/language/stacks/reference/tfstacks-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ $ sudo yum -y install terraform-stacks-cli

The `terraform-stacks-cli` supports the following four commands:

* `tfstacks init`
* `tfstacks validate`
* `tfstacks providers lock [-platform=os_arch]`
* `tfstacks plan -organization=org_name -stack=stack_id -deployment=deployment_name [-hostname=hostname]`
* [`tfstacks init`](#tfstacks-init-command)
* [`tfstacks validate`](#tfstacks-validate-command)
* [`tfstacks providers lock [-platform=os_arch]`](#tfstacks-providers-lock-command)
* [`tfstacks plan -organization=org_name -stack=stack_id -deployment=deployment_name [-hostname=hostname]`](#tfstacks-plan-command)
* [`tfstacks fmt`](#tfstacks-fmt-command)

Each Stack command supports [global options](#global-options).

Expand Down Expand Up @@ -128,6 +129,18 @@ The `tfstacks plan` accepts the following arguments.
| `-deployment=` | Set the `deployment` flag to the deployment name you want to perform this plan in. The deployment name must match one of the deployment names you specified in the `tfdeploy.hcl` file.<br/><br/>Alternatively, you can set an environment variable named `TFSTACKS_DEPLOYMENT` with the same value. | Required |
| `-hostname=` | You can set the `hostname` flag to the hostname of the HCP Terraform instance you want to perform this plan in. The default value is `app.terraform.io`.<br/><br/>Alternatively, you can set an environment variable named `TFSTACKS_HOSTNAME` with the same value. | Optional |

### `tfstacks fmt` command
rkoron007 marked this conversation as resolved.
Show resolved Hide resolved

-> The `tfstacks fmt` command requires v0.6.0 of the `terraform-stacks-cli` or higher. Refer to [installation](#installation) for instructions.

The `tfstacks fmt` command scans your current directory for Stack configuration files, `.tfstack.hcl` and `.tfdeploy.hcl`, and formats those files to match Terraform's canonical format and style.

```shell-session
$ tfstacks fmt
```

The `tfstacks fmt` command uses the same formatting rules as the Terraform CLI's `terraform fmt` command. Refer to [`terraform fmt`](/terraform/cli/commands/fmt) for more information on formatting rules.

## Global options

You can apply the following global options to any `tfstacks` command:
Expand Down
Loading