I've created a Node v12 (5.2.2 platform) elastic beanstalk app, and set the env vars in the EB console.
Locally, I use dotenv to load envs, but EB does it their own way. The env variables are recognized when I view the elastic beanstalk server logs, but when I ssh into the EC2 instance, and console.log(process.env), or echo $MY_ENV_VAR, none of the values are set.
So, I source'd the env vars at /opt/elasticbeanstalk/deployment/env and can now echo them, but running migrations shows that the env vars are still unset, and console.log(process.env) shows none of them are set.
Why is this? How do I ensure they're set so I can run migrations and other commands that require envs?
/root/.ebextensions/environmentvar.config:
option_settings:
aws:elasticbeanstalk:application:environment:
TEST_VAR: helloworld