Format all files terraform
Recursively format all .tf files in subdirectories
terraform fmt -recursive
more terraform
all 43 commands →
Validate configuration
terraform validate
Plan with var file
terraform plan -var-file=prod.tfvars -out=prod.tfplan
Apply saved plan
terraform apply prod.tfplan
Show resource in state
terraform state show 'aws_instance.web[0]'
Move resource in state
terraform state mv 'aws_instance.web' 'module.app.aws_instance.web'