Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 151


What does terraform refresh modify?

Show Answer
Correct Answer: B

The terraform refresh command updates the Terraform state file to reflect the current state of the infrastructure. It reads the current settings from all managed remote objects and ensures that the state file in Terraform matches the actual configuration of the resources, without making changes to the cloud infrastructure, the Terraform plan, or the Terraform configuration. This helps maintain an accurate representation of the infrastructure within Terraform's management.

Discussion

7 comments
Sign in to comment
Uma10Option: B
Sep 2, 2022

The answer is correct. The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match. Source: https://www.terraform.io/cli/commands/refresh

bora4motionOption: B
Sep 2, 2022

I go with B

depal_dhirOption: B
Sep 7, 2022

https://www.terraform.io/cli/commands/refresh

dani88geOption: B
Oct 11, 2022

It's B.

G4ExamsOption: B
Nov 1, 2022

refresh updates the state if there was a manuell change in the infrastructure, for example via aws consule.

campsOption: B
Mar 31, 2023

B. Your state file. The terraform refresh command in Terraform is used to update the Terraform state file with the current real-world state of the infrastructure. When the terraform refresh command is run, Terraform reads the current state of the resources from the infrastructure provider, and then updates the state file with any changes that have occurred outside of Terraform.

090200fOption: B
Jul 19, 2024

it's a state file, so answer is B