Terraform commands
auto approve
terraform apply -auto-approveinitialize
terraform initpreview terraform actions
The terraform plan command creates an execution plan, which lets you preview the changes that Terraform plans to make to your infrastructure. By default, when Terraform creates a plan it:
Reads the current state of any already-existing remote objects to make sure that the Terraform state is up-to-date.
Compares the current configuration to the prior state and noting any differences.
Proposes a set of change actions that should, if applied, make the remote objects match the configuration.
terraform planapply configuration with variables
terraform apply -var-file terraform-dev.tfvarsdestroy a single resource
terraform destroy -target aws_vpc.myapp-vpcdestroy everything fromtf files
show resources and components from current state
show current state of a specific resource/data
set avail_zone as custom tf environment variable - before apply
Last updated