Terraform CLI Flashcards

1
Q

Name the command for running terraform command in a different path

A

terraform -chdir=<path_to/tf> <sub_command></sub_command>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What should you do first after writing your new terraform configuration?

A

terraform init
Initializes working directory containing your terraform config files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you store the plan to a file?

A

terraform plan -out <plan_name></plan_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you dry run destroy?

A

terraform plan -destroy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you apply a specific plan?

A

terraform apply <plan_name></plan_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you apply changes to a specific resource?

A

terraform apply -target=<resource_name></resource_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you pass a variable to the apply command?

A

terraform apply -var my_variable=<variable></variable>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you list all providers used in your config?

A

terraform providers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly