Rationale for Correct Answer: In refresh-only mode, Terraform updates the state based on the existing state and the real infrastructure returned by provider APIs. It does not use resource configuration arguments to propose infrastructure changes. The goal is to reconcile Terraform state with remote objects, not to change infrastructure to match configuration.
Analysis of Incorrect Options (Distractors):
B. Authentication credentials for the provider. Incorrect. Terraform needs provider credentials to query the real infrastructure.
C. The most recent state file. Incorrect. Terraform uses the current state as the baseline for determining which managed objects to refresh.
D. The actual infrastructure as reported by the provider API. Incorrect. This is exactly what Terraform consults to refresh state.
Key Concept: terraform apply -refresh-only updates Terraform state from real infrastructure without applying configuration-driven infrastructure changes.
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit