Ace the Terraform Associate Exam 2025 – Build Your Cloud Dream Team!

Question: 1 / 400

What would happen if a resource is missing from the state file?

Terraform deletes it automatically

Terraform cannot access it for modification

When a resource is missing from the state file, Terraform cannot access it for modification. The state file acts as a source of truth for the current infrastructure managed by Terraform. It keeps track of the resources that have been created and their respective configurations. If a resource is absent from the state file, Terraform has no information regarding its current state or configuration. As a result, any changes or modifications to that resource cannot be managed through Terraform, since it operates based on the data present in the state file.

This situation may arise due to various reasons, such as manually deleting a resource directly in the cloud provider or errors in state management. Consequently, while Terraform can manage resources that are present in the state file, it cannot modify or manage resources that it is unaware of, creating potential discrepancies between what Terraform thinks exists and the actual infrastructure.

The other options do not correctly describe the outcome of a resource being missing from the state file. Terraform does not automatically delete resources simply because they are untracked, nor does it recreate them during the apply phase without any instruction or evidence that they should be present. Terraform also does not ignore the resource in a manner that allows it to bypass management; instead, it simply cannot act upon it since it has no reference

Get further explanation with Examzify DeepDiveBeta

Terraform recreates it during apply

Terraform ignores it during deployment

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy