Interview Prep/Terraform/Workflow and CLI

What is `terraform apply -refresh-only` and how does it relate to `terraform refresh`?

IntermediateConceptWorkflow and CLI
Answer

-refresh-only reads real infrastructure and proposes updating state to match it, without changing resources, and lets you review the diff. The old terraform refresh did the same unreviewed and is deprecated because it could overwrite state silently, for instance after a credentials mistake.

All Terraform questions Roadmap: Terraform

More on Workflow and CLI