What Are Terraform Commands?
Terraform init
Terraform init command initializes a Terraform working directory by downloading and installing any required plugins and dependencies. It should be run before any other Terraform commands.
$ terraform init
Terraform Validate
The validate command performs precisely what its name implies. It ensures that the code is internally coherent and examines it for syntax mistakes. Only the configuration files (*.tf) in the active working directory are examined. You must provide the -a recursive flag if you want to validate files inside of folders (for example, if you have a module/ directory).
$ terraform validate
Terraform Apply
Terraform apply command applies the changes defined in the configuration to your infrastructure. It creates or updates the resources according to the configuration, and it also prompts you to confirm the changes before applying them.
$ terraform apply
Terraform Destroy
Terraform destroy command will destroy all the resources created by Terraform in the current working directory. It is a useful command for tearing down your infrastructure when you no longer need it.
$ terraform destroy
Terraform Import
Imports an existing resource into the Terraform state, allowing it to be managed by Terraform.
$ terraform import
Terraform Console
Opens an interactive console for evaluating expressions in the Terraform configuration.
$ terraform console
Terraform Refresh
This command updates the state of your infrastructure to reflect the actual state of your resources. It is useful when you want to ensure that your Terraform state is in sync with the actual state of your infrastructure.
$ terraform refres
What is Terraform?
Terraform is a popular infrastructure-as-code tool that allows you to automate the provisioning and management of infrastructure resources. It uses configuration files written in the HashiCorp Configuration Language (HCL) to define the desired state of your infrastructure, and it uses various commands to apply those configurations and manage your infrastructure resources.