All technological notes.
terraform init -> terraform validate -> terraform plan -> terraform applyterraform plan planfile
terraform initterraform validateterraform plan planfileterraform apply planfile -auto-approveterraform apply -target resource_type.resource_name plan_file can be used.| Command | Description |
|---|---|
terraform fmt |
Rewrites Terraform configuration files to a canonical format. |
terraform validate |
Checks whether the configuration files are valid. |
terraform plan |
Creates an execution plan showing the changes that Terraform plans to make. |
terraform plan -out plan_file |
Save the generated plan to a file on disk |
terraform apply |
Creates and executes a new execution plan with an interative prompt |
terraform apply -target module.module_name |
Apply only a module |
terraform apply plan_file |
Apply a plan from a file |
terraform apply -auto-approve |
Skips interactive approval of the plan |
terraform destroy |
Destroys the Terraform-managed infrastructure. |
terraform destroy -auto-approve |
Skips interactive approval of the plan |
terraform destroy -target aws_instance.example |
Destroys a specific infrastructure. |
terraform refresh |
Updates the state file against real resources in a provider. |
terraform state |
Advanced state management commands for your Terraform state. |
terraform output |
Displays outputs from your Terraform state data. |