0
0
Terraformcloud~10 mins

Terraform destroy for cleanup - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run the Terraform command that destroys all managed infrastructure.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Aapply
Bdestroy
Cplan
Dinit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'terraform apply' which creates or updates resources instead of destroying them.
Using 'terraform plan' which only shows changes without applying them.
2fill in blank
medium

Complete the command to destroy infrastructure without asking for confirmation.

Terraform
terraform destroy [1]
Drag options to blanks, or click blank then click option'
A-skip-approve
B-force
C-auto-approve
D-no-confirm
Attempts:
3 left
💡 Hint
Common Mistakes
Using flags that do not exist like '-force' or '-no-confirm'.
Forgetting to add any flag and getting prompted for confirmation.
3fill in blank
hard

Fix the error in the command to destroy resources in a specific workspace.

Terraform
terraform workspace select [1] && terraform destroy -auto-approve
Drag options to blanks, or click blank then click option'
Adefault
Bmain
Cproduction
Ddev
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting the wrong workspace name that does not exist.
Not selecting any workspace and destroying resources in the default workspace.
4fill in blank
hard

Fill both blanks to destroy resources using a specific Terraform state file and skip confirmation.

Terraform
terraform [1] -state=[2] -auto-approve
Drag options to blanks, or click blank then click option'
Adestroy
Bapply
Cterraform.tfstate
Dprod.tfstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' instead of 'destroy' which creates or updates resources.
Using the wrong state file name or forgetting to specify it.
5fill in blank
hard

Fill all three blanks to destroy resources with a plan file and skip confirmation.

Terraform
terraform [1] [2] [3]
Drag options to blanks, or click blank then click option'
Aapply
B-auto-approve
Cdestroy.plan
D-state=terraform.tfstate
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of arguments or using incorrect flags.
Using 'destroy' instead of 'apply' when applying a destroy plan file.