Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 292


What does terraform refresh-only modify?

Show Answer
Correct Answer: D

The 'terraform refresh' command updates the state file with the latest real-world state of your cloud infrastructure. It does not make any changes to the actual cloud resources, Terraform configuration, or plan. Its sole purpose is to refresh the state file to ensure it matches the current state of the infrastructure.

Discussion

2 comments
Sign in to comment
Ramdi1Option: D
Nov 25, 2024

The terraform refresh command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. This can be used to detect any drift from the last-known state and to update the state file. This does not modify infrastructure, but does modify the state file

Stargazer11Option: D
Nov 27, 2024

refresh-only tries to match state file with real world infra. It does not refer to configuration in tf files.