Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to creating bucket for every terraform state: terraform-aws-multi-stack-backends #284

Open
schollii opened this issue Jun 24, 2021 · 1 comment

Comments

@schollii
Copy link

This is not a bug report but rather just wanted to point out an alternative to creating a bucket and dyndb table specifically for the EKS. In your readme in the Configuring a terraform backend section you say "To use the s3 backend, you will need to create the bucket upfront. You need the S3 bucket as well as a Dynamo table for state locks".

I recently created a module https://registry.terraform.io/modules/schollii/multi-stack-backends/aws, that makes this unnecessary, in that once you install this module, it creates a bucket that can be used to store multiple terraform states. Some people prefer one state per bucket, but I find this very noisy, and IMO not a good idea especially with big stacks nowadays it is good practice to split the terraform state into a few parts. And with bucket replication, there is not much risk of loss. My module really simplifies the management of the backends and makes it obvious what states belong together, and provides individual IAM for the state files for those who need it, and generates the backend files for you.

It is still early stage but I have used it in several projects. Any feedback for improvements are naturally welcome.

@ankitm123
Copy link
Member

I will take a look this weekend, sounds interesting. At work, I use terragrunt which creates the state bucket and dynamodb table, but a native terraform solution is a good thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants