nerdexam
HashiCorp

TA-002-P · Question #106

terraform refresh command will not modify infrastructure, but does modify the state file.

The correct answer is A. True. The terraform refresh command queries the actual infrastructure providers to detect any real-world changes made outside of Terraform, then updates the local state file to reflect the current actual state. It is a read-only operation against infrastructure - it makes no changes…

Implement and maintain state

Question

terraform refresh command will not modify infrastructure, but does modify the state file.

Options

  • ATrue
  • BFalse

How the community answered

(33 responses)
  • A
    94% (31)
  • B
    6% (2)

Explanation

The terraform refresh command queries the actual infrastructure providers to detect any real-world changes made outside of Terraform, then updates the local state file to reflect the current actual state. It is a read-only operation against infrastructure - it makes no changes to resources - but it does write updates to the state file to bring it in sync with reality.

Topics

#terraform refresh#state file#infrastructure as code#CLI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice