0

I'm just learning elastic beanstalk and have create a basic mern app. my passwords will be for the mongodb database and for an amazon s3 for image upload, I have held these in .env files, in both front and back-end for seperate resources.

How do I add these .env files, do I just zip the entire project with the .env files and elastic beanstalk is secure enough that I don't need to worry about it?

But if this is the case, how will I do continious deployment, if I use github, I don't store my .env files there.. so I would have to manually zip the project and add it everytime I have an update, its not a problem.. but is it secure? Thanks.

I create my front end with create-react-app , and for my backend, I asked my server to run on the prod.env, so for my front end, I just have to specify the requests, for example axios request, to be made to the prod.env .. whatever it may be, am I correct about this?

Also.. do I upload my node files, or when I create a node environment on elastic, those node files are already there.

Sorry for too many questions, very new on this. thanks.

  • 1
    As you say, .env doesn't get checked into git. You can use the AWS dashboard to add environment variables to your beanstalk instance – azium Feb 23 '20 at 16:37
  • I saw the aws keys area when we are uploading files but I don't think they are for env variables... what dashboard are you referring to, i did not see this –  Feb 23 '20 at 17:09
  • https://stackoverflow.com/questions/11211007/how-do-you-pass-custom-environment-variable-on-amazon-elastic-beanstalk-aws-ebs – azium Feb 23 '20 at 17:17
  • and if you SSH into your aws server you can just handcode any env vars there into a .env or your build script etc – azium Feb 23 '20 at 17:18
  • you can add environment variables in the Configuration tab in the EBS dashboard – paperball Mar 02 '20 at 16:34

0 Answers0