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.
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate