nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #54

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

The correct answer is A. terraform plan -refresh-onlyly. This is the command that always causes a state file to be updated with changes that might have been made outside of Terraform, as it will only refresh the state file with the current status of the real resources, without making any changes to them or creating a plan.

Implement and maintain state

Question

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

Options

  • Aterraform plan -refresh-onlyly
  • Bterraform show -json
  • Cterraform apply -lock-false
  • Dterraform plan -target-state

How the community answered

(41 responses)
  • A
    78% (32)
  • B
    7% (3)
  • C
    2% (1)
  • D
    12% (5)

Explanation

This is the command that always causes a state file to be updated with changes that might have been made outside of Terraform, as it will only refresh the state file with the current status of the real resources, without making any changes to them or creating a plan.

Topics

#terraform plan -refresh-only#state refresh#drift detection#state update

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice