Question:
I have Python code installed in an AWS Elastic Beanstalk environment. This code uses RDS_DB_NAME (and other related environment variables) in the setttings.py file. E.g.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
DATABASES = {} try: from local_settings import * except ImportError, e: DATABASES = { 'default': { 'OPTIONS': { "init_command": "SET foreign_key_checks = 0;", }, 'ENGINE': 'django.db.backends.mysql', 'NAME': os.environ['RDS_DB_NAME'], 'USER': os.environ['RDS_USERNAME'], 'PASSWORD': os.environ['RDS_PASSWORD'], 'HOST': os.environ['RDS_HOSTNAME'], 'PORT': os.environ['RDS_PORT'], } } |
I want to change within the Elastic Beanstalk dashboard where these environment variable point. I.e I want them to point to a different existing RDS database.
Can anyone tell me where in the dashboard these can be changed?
Answer:
IU assume you’ve NOT asked beanstalk to create the RDS for you, which you shouldn’t have due to lack of flexibility. If you open the beanstalk console, navigate to your environment => configuration => software configuration => environment properties. There you can set RDS_DB_NAME
and other environment vars.
This works perfectly for me.