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

Multi region environment deployments #48

Open
thomasrd1 opened this issue Apr 13, 2021 · 5 comments
Open

Multi region environment deployments #48

thomasrd1 opened this issue Apr 13, 2021 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@thomasrd1
Copy link

thomasrd1 commented Apr 13, 2021

What is the best way to insert the .env in a multi region environment?

The deployment would run... ap-southeast-2 (dev > prod) > us-east-1 > eu-central-1

The example works great for a single region (dev>prod), but how can I automatically get the S3 Bucket name, S3 Bucket path for other regions?

image

Would it be easier to add some environment variables and then query them?

image

@rennokki
Copy link
Owner

You can use other buckets as well, only make sure that the EC2 Role has access to read the .env from the S3 bucket.

@thomasrd1
Copy link
Author

I don't want to hard code the S3 bucket / URL to .env

@rennokki rennokki added the help wanted Extra attention is needed label Apr 13, 2021
@rennokki
Copy link
Owner

I guess this can be solved by using AWS Parameter Store. You can define a parameter store and have a custom script that pulls the secrets from the parameter store into a file using the EC2 Role that the machine has to build your .env file. This seems promising and might become a great future on this project. 🤔

I remember I have opened an issue a while ago on AWS EB Roadmap repo that fixes this out-of-the-box: aws/elastic-beanstalk-roadmap#57

@thomasrd1
Copy link
Author

Infrastructure as code is great. Except when you have to define custom codes. What you have here in this project is amazing.

I try not to hard code any bucket/keys anywhere.

There are 2 different options. Pull the config variables from AWS Secrets Manager or the Environment paramaters. Which means you need to have the elasticbeanstalk environment setup as blank before uploading the code.

@rennokki
Copy link
Owner

I failed at searching some old issue where one of the users found that Environment Variables set in AWS Console got copied over automatically by AWS to a file somewhere in /etc or something and you could just use it as-is.

After a bit of research, I have found out about remind101/ssm-env and it seems like it's a better way to approach the issue, but still doesn't solve multi-env without some bits of hardcoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants