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

When do you need to explicitly execute terraform refresh?

    Correct Answer: D

    Terraform refresh explicitly updates the state file with the real infrastructure. Normally, Terraform performs this refresh automatically during the plan and apply commands. Therefore, it is generally unnecessary to execute terraform refresh manually, making 'None of the above' the correct choice.

Discussion
Uma10

The answer is correct. Wherever possible, avoid using terraform refresh explicitly and instead rely on Terraform's behavior of automatically refreshing existing objects as part of creating a normal plan. Source: https://www.terraform.io/cli/commands/refresh

keiffo2

so the answer is D

Pinky0289Option: D

D. None of the above. Refresh is used to check backward compatibility to read the infrastructure objects, and update the state file. Terraform performs refresh by itself during every plan and apply commands. So, it is recommended that we not perform refresh often.

RVivekOption: D

As per Terraform documentation refresh command is not recommended, it is there only for backward compatibility

Darshan07Option: D

D is correct

hajurbauOption: D

D is correct

depal_dhirOption: D

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