Question
Terraform local state file and Amazon S3 backend locking interoperability
Sky Nea
0 reputation · 30 Mar 2020, 16:25 UTC
37.8K views0
<p>One precise goal is to share a single Terraform state store between local development workstations and a production CI/CD pipeline by moving from a local terraform.tfstate file to an Amazon S3 backend.</p>
<p>Assumes a Terraform CLI release that supports the Amazon S3 backend with an external lock table.</p>
<p>The relevant uncertainty is how locking behaves across the integration boundary. Local runs rely on file-system locks, while the remote backend depends on a separate lock table. It is not established whether state created locally can be adopted by the remote backend without risking concurrent-modification conflicts, silent state divergence, or lock-table mismatches during the transition.</p>
<p>Specific questions:</p>
<ul>
<li>Does Terraform verify lock-table compatibility before adopting an existing local state file into an S3 backend?</li>
<li>What conditions must hold for local and remote state to remain interoperable after backend migration?</li>
</ul>