cloudposse/terraform-aws-tfstate-backend ? reverse-engineered prompt
Reverse engineered prompt
Build me a Terraform module that sets up a remote state backend in AWS.
I want it to create an S3 bucket for the terraform state file and a DynamoDB table for state locking, so multiple people or runs do not overwrite each other. Please make the bucket use server side encryption and versioning, and make the lock table encrypted too. It would be great if it can also write out a backend config file for me so I can bootstrap a new project more easily.
I also want an easy way to turn on disaster recovery with S3 replication to another bucket if I provide its ARN. Keep the setup straightforward, and include the usual outputs I would need to plug the backend into a Terraform project. If anything needs special Terraform init steps to move state from local to S3, make sure the README explains that clearly.
Are you gonna build this?
make sure you review the code using coderabbit