Overview ๐Ÿ“˜

S.No Command Description
1 Terraform init To initialize, provide the plugins, and require the dependency lock files.
2 Terraform init --upgrade Upgrade the version of the provided plugins.
3 terraform get Download and update the dependencies.
4 Terraform plan Execution of the providers in the Terraform configuration.
5 Terraform apply Used to apply changes and create the infrastructure.
6 Terraform apply -auto-approve Used to apply changes and create the infrastructure without approval.
7 Terraform apply -replace=<resource_name> Used to replace a specific resource in your infrastructure.
8 Terraform workspace new To create a new workspace in your Terraform configuration.
9 Terraform workspace list To display the list of workspaces in your Terraform configuration.
10 Terraform workspace select <workspace_name> To switch to a different workspace in your Terraform configuration.
11 Terraform workspace delete <workspace_name> To delete a specific workspace.
12 Terraform workspace show To display the name of the current workspace.
13 Terraform import resource_name.attribute To import existing resources into a Terraform state file.
14 Terraform show To display the current state of your infrastructure as represented by the Terraform state file.
15 Terraform destroy To destroy the total infrastructure created by Terraform.
16 Terraform apply destroy --auto-approve To destroy resources without approval.
17 Terraform providers To list currently installed providers on your system.
18 Terraform version To display the current version of Terraform.
19 Terraform output To display the values of the output variables defined in your Terraform configuration.
20 Terraform state pull To download the current state data.
21 Terraform state list To list all resources managed by Terraform.
22 Terraform validate To validate the syntax and configuration of Terraform files.
23 Terraform fmt To format Terraform configuration files in canonical and aligned format.
24 Terraform refresh To update only modified files in your Terraform configuration.
25 Terraform mv To move or rename files or directories in a Terraform configuration.
26 Terraform state push To upload the local state file to a remote state.
27 Terraform providers lock To lock provider dependencies for a Terraform configuration.