ExamGecko
Question list
Search
Search

Question 3 - Terraform Associate 003 discussion

Report
Export

You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.

What will happen you run terraform apply in the working directory again?

A.
Terraform will remove the virtual machine from the state file, but the resource will still exist
Answers
A.
Terraform will remove the virtual machine from the state file, but the resource will still exist
B.
Nothing
Answers
B.
Nothing
C.
Terraform will error
Answers
C.
Terraform will error
D.
Terraform will destroy the virtual machine
Answers
D.
Terraform will destroy the virtual machine
Suggested answer: D

Explanation:

This is what will happen if you runterraform applyin the working directory again, after removing the resource definition from your Terraform configuration file. Terraform will detect that there is a resource in the state file that is not present in the configuration file, and will assume that you want to delete it.

asked 18/09/2024
Jorge Correa
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first