I'm trying to setup two Rails applications. I want both of them to use one MySQL database. My setup is like this:
With Elastic Beanstalk I've setup two Rails applications with two diffrent enviroments. One of those applications I setup with a MySQL database. So now I have two EC2 instances - one for each rails app and one RDS MySQL instance.
I setup Security Groups in both EC2 instances to be able to connect to MYSQL via
database: <%= ENV['RDS_DB_NAME'] %>
username: <%= ENV['RDS_USERNAME'] %>
password: <%= ENV['RDS_PASSWORD'] %>
host: <%= ENV['RDS_HOSTNAME'] %>
port: <%= ENV['RDS_PORT'] %>
Problem solved - instead of the ENV variables I set the DB credentials in the database.yml file. The enviroment variables were overwritten by every push with
git aws.push on elastic beanstalk.