title: How environment variables are used when deployed on aws
body: <p>I am building a web application that utilises environment variables locally, and I want to put this on production (online). I am trying to find out how to set environment variables on AWS. </p>
  
  <p>This is a node.js application and I am using elastic beanstalk on AWS for deployment. I have looked through <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/env-vars.html#env-vars-env-list" rel="nofollow noreferrer">https://docs.aws.amazon.com/cloud9/latest/user-guide/env-vars.html#env-vars-env-list</a> , but I'm unsure of which option applies to me. </p>
  
  <p>The .env file I have locally contains lines like</p>
  
  <p>PASSWORD=MYPASSWORD</p>
  
  <p>and I am using the dotenv package, with require('dotenv').config(); in the appropriate files. I am accessing environment variables in my code through things like process.env.PASSWORD (using the aforementioned example of a line in the .env file).</p>
  
  <p>I've tried searching several places and am presented with various options, but I'm not sure which one applies to my environment variables.</p>