nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #15

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…

The correct answer is C. The Terraform state file only contains the one new VM. Execute terraform destroy. 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.

Tools for Test Analysts

Question

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?

Options

  • AThe Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and
  • BDelete the Terraform state file and execute terraform apply.
  • CThe Terraform state file only contains the one new VM. Execute terraform destroy.
  • DDelete the VM using the cloud provider console and terraform apply to apply the changes to the

How the community answered

(26 responses)
  • A
    8% (2)
  • B
    4% (1)
  • C
    85% (22)
  • D
    4% (1)

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.

Topics

#Terraform#state file scope#terraform destroy#VM management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice