How S3 Strong Consistency can simplify Terraform remote state locks

AWS introduced strong consistency for S3 in December 2020. This can simplify Terraform remote state locking.

I highly recommend Werner Vogels’ blog post on S3 Consistency (https://www.allthingsdistributed.com/2021/04/s3-strong-consistency.html). Werner is the CTO of Amazon. In his blog posts he describes how they implemented strong consitency in S3 by introducing a cache coherence protocol. That is probably the most important evolution step of S3 since its introduction in 2006.

S3 strong consistency can simplify Terraform remote state locks. Obviously we need strong consistency when we deal with locks and S3 was only eventually consistent back in the day. This why HashiCorp decided to use DynamoDB for locking instead of S3. The necessity of that additional overhead is now gone and there is an open feature request with HashiCorp (https://discuss.hashicorp.com/t/feature-request-terraform-state-locking-in-aws-with-s3-strong-consistency-no-dynamodb/18456).

Once implemented it will simplify remote backend configuration as we can write terraform lock files directly in S3 then.

Contact