Elastic Beanstalk connect to RDS from shell SSH

后端 未结 3 822
走了就别回头了
走了就别回头了 2021-02-02 17:16

I have a python application on an Elastic Beanstalk EC2 instance which is connected to an PostgreSQL RDS.

My application works fine and uses the environment variables th

3条回答
  •  情书的邮戳
    2021-02-02 17:56

    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.

提交回复
热议问题