terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Support for S3 Multi Access Point as Backend

Open sarasensible opened this issue 3 years ago • 2 comments

Terraform Version

1.3.3

Use Cases

The end goal is to have state stored across replicated S3 buckets and accessed via a single endpoint. This is useful from a disaster recovery standpoint so that in case of an outage in a particular region Terraform will still work transparently without having to switch to a backup bucket.

Attempted Solutions

I tried using the S3 backend however since the MRAP is global it has no region, therefore providing its alias to the bucket config does not work.

Proposal

Although this uses S3 under the hood, I believe this should be its own backend since the S3 API does not treat MRAPs the same way as regular S3 buckets. It does not support the Copy API for example, only the Put API.

References

No response

sarasensible avatar Oct 25 '22 14:10 sarasensible

Hi @sarasensible, thanks for this suggestion. Would S3 Cross-Region Replication (CRR) (https://docs.aws.amazon.com/AmazonS3/latest/userguide//replication.html) work for your use case? It looks like MRAP makes use of both CRR and AWS Global Accelerator to serve files from the region with the lowest latency

gdavison avatar Oct 28 '22 00:10 gdavison

Thanks for your reply @gdavison . I am currently making use of S3 CRR in lieu of MRAP and the downside is that I have to specify one of the two replicating buckets as a backend. This introduces a manual step - if the region of the bucket I chose were to go down, I would need to swap over to the replicated bucket. If I could use MRAP the failover would happen automatically via the singular endpoint. At least that's how I visualize it.

sarasensible avatar Oct 28 '22 13:10 sarasensible