Hello everyone,
I have two specific questions about how the S3 backend handles state during an apply operation, especially regarding timing and failure recovery.
-
When using the S3 backend, at what exact point during the
terraform applyprocess is the state file in the S3 bucket actually updated? (For example, is it updated incrementally as each resource is provisioned, or only written once at the very end after all resources are successfully applied?) -
What happens if the
terraform applyprocess is interrupted, exits abnormally, or iskilled while it is in the middle of applying changes? Is it possible to end up in a situation where some resources were successfully created in the cloud but are not recorded in the S3 state file? If this happens, what is the recommended recovery process to fix this and get the state file back in sync with reality?
Thank you in advance for any insights!