nerdexam
HashiCorp

TA-002-P · Question #215

Command terraform refresh will update state file?

The correct answer is B. True. 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…

Implement and maintain state

Question

Command terraform refresh will update state file?

Options

  • AFalse
  • BTrue

How the community answered

(48 responses)
  • A
    15% (7)
  • B
    85% (41)

Explanation

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. If the state is changed, this may cause changes to occur during the next plan or apply.

Topics

#terraform refresh#state file#state management#CLI commands

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice