Back to technologies

/terraform

Terraform command reference

Core Terraform CLI commands for validating and provisioning infrastructure.

14 matches

Setup & Validation

4 commands

terraform init

Initialize a Terraform working directory.

terraform fmt -recursive

Format Terraform files consistently.

terraform validate

Validate configuration syntax and internal consistency.

terraform providers

List the providers required by the configuration.

Plan & Apply

4 commands

terraform plan

Preview infrastructure changes.

terraform apply

Apply the planned infrastructure changes.

terraform apply -auto-approve

Apply changes without interactive approval.

terraform destroy

Destroy managed infrastructure resources.

State & Workspaces

6 commands

terraform show

Display the current state or a saved plan.

terraform output

Show output values from the state file.

terraform state list

List resources tracked in state.

terraform import <address> <id>

Import an existing resource into state.

terraform workspace list

List available Terraform workspaces.

terraform workspace select dev

Switch to a different workspace.