I set environment properties for my AWS Elastic Beanstalk environment. I don't see these properties when I log in to an Amazon Elastic Compute Cloud (Amazon EC2) instance in my Elastic Beanstalk environment and list the environment variables in the shell.
Short description
Even though they are present in an instance, environment properties aren't automatically exported to the shell, except for in stacks that run PHP. Instead, environment properties are made available to the application through the stack that it runs in, based on the platform that you use.
To view and set environment properties, use the Elastic Beanstalk console or the eb setenv command in the Elastic Beanstalk Command Line Interface (EB CLI).
The following resolution shows how to set the source for environment properties in several platforms. For information on additional platform-specific options, see Environment properties and other software settings. For information on how to access environment properties outside your code, see Platform script tools.
Resolution
Important: The following resolutions apply only to Amazon Linux Amazon Machine Images (AMIs). For Amazon Linux 2 instances, see How do I use environment variables from an Elastic Beanstalk instance shell?
PHP, Python, Ruby, Node.js, and Java
For environment variable paths that are inside the instance, run the following command:
$ cat /opt/elasticbeanstalk/deployment/env
To verify the environment variables, run the following command:
$ /opt/elasticbeanstalk/bin/get-config environment
Windows
For Windows platforms, run the following command:
C:\Program Files\Amazon\ElasticBeanstalk\config\containerconfiguration