1

I'm using ElasticBeanstalk for many apps and many environments (not that many but just making a point here). I'd like to have my databases (RDS instances) have human-readable names. When I change a value in my .elasticbeanstalk/optionsettings.<app>-<env> for DBInstanceIdentifier - that entire line gets deleted when I run eb start

What can I do here? I don't want to just change things in the AWS web UI because I want everything to be reproducible via command-line if needed (like when things crash).

1 Answer 1

3

Create a file called .ebextensions/01-rds.config in your app source. The contents of the file should be as follows:

Resources:
    AWSEBRDSDatabase:
        Type: AWS::RDS::DBInstance
        Properties:
            DBInstanceIdentifier: MyDatabase

Note this file is in YAML format, so indentation is important.

Then run 'eb start' to create a new environment.

This will allow you to override the name of the RDS resource created by Elastic Beanstalk.

You can read more about customizing environments using ebextensions here. Documentation about customizing environment Resources is available here.

Let me know if you run into any difficulties or have more questions.

4
  • I've seen this documentation page, but I had extremely hard time understanding what it was talking about. It never mentioned that these are the same resources as in optionsettings and they will override any of those settings! Will definitely try this!
    – Mikhail
    Aug 31, 2014 at 18:43
  • This isn't exactly what I was asking -- This allows me to boot up a new environment and have it connect to a database with DBName. What I want is to create a new database with a specified name.
    – Mikhail
    Aug 31, 2014 at 20:03
  • I think the above solution satisfies your usecase. Since you are using eb cli, when you run eb init just answer yes for the question as you normally would when asked if you want to create a database. Before you run eb start make sure you have the ebextension config file above in your source code. You need a combination of both. The ebextension lets you overwrite the RDS configuration generated by eb init. Let me know if I am missing something. Sep 1, 2014 at 3:01
  • Actually slight correction here. I used property name "DBName" instead of "DBInstanceIdentifier" in my answer. Using DBInstanceIdentifier will help you achieve custom name of the DB instance. Fixed the answer. Dec 31, 2014 at 5:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .