Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 301

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

    Correct Answer: A

    The 'terraform plan -refresh-only' command updates the state file with the current state of resources in the real world, without performing any changes. It ensures that the state file reflects any changes made outside of Terraform, providing an accurate comparison between the Terraform configurations and the actual infrastructure.

Discussion
Stargazer11Option: A

Neither one of them is correct. Should be terraform apply -refresh-only

[Removed]Option: A

A - terraform plan -refresh-only

dev_maftunaOption: A

A. The -refresh-only flag with the terraform plan command updates the state file with the current state of the real resources, without applying any changes. This command compares the current state of the infrastructure with the Terraform configuration and updates the state file with any changes that were made externally.

vindi135Option: A

A. is the closest answer but not quite the right command that would make the changes to the state file. Its terraform apply -refresh-only

dev_maftunaOption: A

A. terraform plan -refresh-only

kareem_ashraf

non is correct , some thing maybe wrong with this question , should be terraform refresh i think

petersolimanOption: A

A is the correct answer