Cloud Foundry RDS Service Broker
Cloud Foundry Service Broker to manage RDS instances and a shared RDS Database.
There are important environment variables that should be overriden inside the
Note: All environment variables prefixed with
DB_refer to attributes for the database the broker itself will use for internal uses.
DB_URL: The hostname / IP address of the database.
DB_PORT: The port number to access the database.
DB_NAME: The database name.
DB_USER: Username to access the database.
DB_PASS: Password to access the database.
DB_TYPE: The type of database. Currently supported types:
DB_SSLMODE: The type of SSL Mode to use when connecting to the database. Supported modes:
AWS_ACCESS_KEY_ID: The id credential with access to make requests to the Amazon RDS .
AWS_SECRET_ACCESS_KEY: The secret key (treat like a password) credential to access Amazon RDS.
INSTANCE_TAGS: Tags for the RDS instances.
AWS_SEC_GROUP: The security group for the RDS instances (
AWS_DB_SUBNET_GROUP: The name of DB subnet group for the RDS instances.
Note the AWS Environment Variables should be generated by following the instructions here
Make sure the account has write access to RDS and EC2 (particularly for VPC and Subnet).
Example of permissions that suffice:
How to deploy it
cf create-service-broker SERVICE-NAME USER PASS https://BROKER-URL
cf enable-service-access rds
How to use it
To use the service you need to create a service instance and bind it:
cf create-service rds shared-psql MYDB
cf bind-service APP MYDB
When you do that you will have all the credentials in the
VCAP_SERVICES environment variable with the JSON key
Also, you will have a
DATABASE_URL environment variable that will
be the connection string to the DB.
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.