Terraform CLI Flashcards
Name the command for running terraform command in a different path
terraform -chdir=<path_to/tf> <sub_command></sub_command>
What should you do first after writing your new terraform configuration?
terraform init
Initializes working directory containing your terraform config files
How do you store the plan to a file?
terraform plan -out <plan_name></plan_name>
How do you dry run destroy?
terraform plan -destroy
How do you apply a specific plan?
terraform apply <plan_name></plan_name>
How do you apply changes to a specific resource?
terraform apply -target=<resource_name></resource_name>
How do you pass a variable to the apply command?
terraform apply -var my_variable=<variable></variable>
How do you list all providers used in your config?
terraform providers