ExamGecko
Question list
Search
Search

Question 109 - Terraform Associate 003 discussion

Report
Export

You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?

A.
The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
Answers
A.
The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
B.
Delete the Terraform state file and execute terraform apply.
Answers
B.
Delete the Terraform state file and execute terraform apply.
C.
The Terraform state file only contains the one new VM. Execute terraform destroy.
Answers
C.
The Terraform state file only contains the one new VM. Execute terraform destroy.
D.
Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.
Answers
D.
Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.
Suggested answer: C

Explanation:

This is the best way to delete the newly-created VM with Terraform, as it will only affect the resource that was created by your configuration and state file. The other options are either incorrect or inefficient.

asked 18/09/2024
Manoj A Rajan
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first