Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
To prevent two Terraform runs from changing the same state file at the same time, you should configure state locking for your state backend. State locking ensures that operations that could potentially write to the state are serialized, meaning only one operation can modify the state at a given time. This prevents concurrent operations from corrupting the state file.
"If supported by your backend, Terraform will lock your state for all operations that could write state. This prevents others from acquiring the lock and potentially corrupting your state." https://developer.hashicorp.com/terraform/language/state/locking