# Terraform commands

In 
Published 2022-12-03

This tutorial explains some This tutorial explains some Terraform commands.

terraform init command

  • command is used to initialize a working directory containing Terraform configuration files
  • this is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control
  • it is safe to run this command multiple times
  • after initialization, you will be able to perform other commands, like "terraform plan" and "terraform apply"

terraform fmt command

  • command is used to rewrite Terraform configuration files to a canonical format and style
  • this command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability

terraform validate command

  • runs checks that verify whether a configuration is syntactically valid and internally consistent

terraform plan

  • command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure

terraform apply command

  • executes the actions proposed in a Terraform plan

terraform destroy command

  • convenient way to destroy all remote objects managed by a particular Terraform configuration