Terramate-Terraform State Locking Coordination in Nested Stacks
0 reputation · 12 Apr 2023, 17:20 UTC
The goal is to understand how Terramate’s orchestration layer interacts with Terraform’s native state‑locking mechanism when managing nested stacks. Terramate generates HCL and orders execution based on a dependency graph, but it does not provide its own lock; each Terraform invocation relies on the configured backend to acquire a lock on the state file. In complex hierarchies, stacks may share a remote backend or be executed concurrently via terramate run, raising questions about whether locking is serialized or if concurrent operations could corrupt state.
Does Terramate serialize Terraform calls to prevent overlapping state locks when stacks share a backend? How does the locking behavior differ between independent stacks and those that reference each other’s state? What guarantees, if any, does Terramate provide for atomicity across a chain of dependent stacks during a parallel run?