Q: What's the point for the terraform plan operation to lock the state by default?
(I know it might be disabled with -lock=false)
Context:
- (As far as I understand) The
planoperation is not supposed to alter state. plandoes start with some version ofrefresh(which typically alters state), but even the standard output ofterraform planpro-actively says it's not the case with the plan-initiated refresh:
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
- I saw this question on the Hashicorp website, which doesn't seem to provide a conclusive answer.