Terraform Commands
This command will initialize the working directory containing Terraform configuration files and install any required plugins.
terraform initThis command lets you preview the actions Terraform would take to modify your infrastructure or save a speculative plan which you can apply later.
terraform planThis command executes the actions proposed in a terraform plan. It is used to deploy your infrastructure. Typically apply should be run after terraform init and terraform plan. Enter yes when prompted "Enter a value:".
terraform applyThis command will show whether the syntax used is correct or not
terraform validateThis command scans the configuration files in the current working directory and formats the code. It is used to improve the readability of files.
terraform fmtThis command will list all the providers used in the configuration file
terraform providersThis command will mirror the provider configuration in a new path.
terraform providers mirror /<file_path>This command will print all the output variables in the configuration files
terraform outputThis command is used to sync the terraform with real-world resources
terraform refreshThis command will show the resources we have created.
To destroy the infrastructure
Last updated