[TIL] Useful terraform commands

Listing some useful Terraform commands I've been using lately.

Initialize a working directory

terraform init

Create an execution plan with preview

terraform plan

Execute actions proposed in a plan

terraform apply

Format configuration files into a canonical format and style

terraform fmt

More about terraform fmt.

Extract the value of an output variable from the state file

terraform output

Destroy all remote objects managed by a particular configuration

terraform destroy

More about terraform destroy.