A candidate is comparing 'terraform plan' and 'terraform apply' in Terraform 1.x. Which statement correctly distinguishes what each command does to real infrastructure and to state?
- ABoth commands can modify real resources, but only apply writes the results back to the state file.
- BPlan modifies infrastructure to match the configuration, while apply merely reports what plan already changed.
- CPlan previews the proposed actions without changing infrastructure, while apply executes them and updates state. Correct
- DPlan and apply are interchangeable, so either one both previews and enacts the changes in a single step.
Why A is wrong: This is tempting because both read state, but plan never modifies real resources; it only previews the actions apply would take.
Why B is wrong: This reverses the roles: plan is the preview and apply is the command that actually enacts changes, not the other way round.
Why C is correct: Plan is read-only against real resources and produces a preview, whereas apply carries out the actions and records the outcome in state.
Why D is wrong: They are distinct phases; plan cannot enact changes and treating them as interchangeable would defeat the review step apply relies on.