During a code review, a reviewer notices the whole team's cloud infrastructure is now expressed as Terraform configuration files committed to the shared Git repository. Which practical benefit does keeping these files under version control provide?
- AIt removes the need for a Terraform state file, because Git history already records every resource that currently exists.
- BIt guarantees that applied infrastructure can never drift from the configuration, since Git blocks any out-of-band change.
- CIt encrypts the credentials stored inside the configuration automatically whenever a commit is pushed to the shared repository.
- DIt lets the team review proposed infrastructure changes as diffs, roll back to a previous revision, and see who changed what and when. Correct
Why A is wrong: This is tempting because both track history, but Git versions the configuration, not live resource identifiers; Terraform still needs its state file to map configuration to real resources.
Why B is wrong: Version control cannot prevent someone editing resources directly in the console, so drift is still possible; Git records file history but does not police the live environment.
Why C is wrong: This invents a security feature; Git does not encrypt file contents on push, and secrets committed in plain text stay readable, which is why they should be kept out of the configuration.
Why D is correct: Because the configuration is text under version control, standard Git workflows apply: pull-request diffs, rollbacks to earlier revisions, and an author and timestamp for every change.