Elastic Beanstalk connect to RDS from shell SSH

北城余情 提交于 2019-12-02 20:55:48

I figured it out this morgning:

The environment variables are not set within the virtualenv, but by another script. First you have to activate the virualenv, then you need to load the variables by activating the env script in the 'current' directory. Like this:

source /opt/python/run/venv/bin/activate
source /opt/python/current/env

The Beanstalk RDS variables are now set and ready to use by any script you execute in SSH.

I did not find the scripts you have mentionned but find another way to reach the same information.

cd /opt/elasticbeanstalk/bin
sudo ./get-config environment

Get config script allow you to get access to a lot of indormaftion on this categories :

optionsettings                   environment option settings that affect instance
container                        container specific configurations
addons                           addon configurations
environment                      environment variables
meta                             EB environment meta-data

Hope it helps.

Unfortunately, environment variables are not available outside of Elastic Beanstalk container.

As an alternative you can add .profile file to ec2-user home and set those environment variables there, for SSH sessions. Remember, that the file will be gone on rebuild. To make it permanent, add the profile file to your project and copy to ec2-user home with container command.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!