This application sets up a Cloud Foundry v2 service broker to provide access to a CouchDB server.
This was developed specifically to support the Stackato v3.4 environment, but should work for any Cloud Foundry v2 based PaaS.
All of the broker's settings are configured in config/setting.yml
.
Access to the service broker requires basic HTTP authentication. The credentials required are set here.
CouchDB IP address, port, and admin credentials are set here.
- Push as a new application to Stackato as usual. A basic
stackato.yml
manifest is provided for this purpose. - Register the broker:
stackato add-service-broker
A new database can be generated on the targeted CouchDB instance by creating a new service instance:
e.g. on Stackato v3: stackato create-service couchdb newdb myapp
User credentials can be generated and bound to the new database by binding the app to the service:
e.g. on Stackato v3: stackato bind-service newdb myapp
Credentials for the new user are automatically passed as an environment variable (VCAP_SERVICES['couchdb']['credentials']
) in the bound app's container.
Previously generated user credentials can be deleted from the CouchDB instance by unbinding the associated service and app:
e.g. on Stackato v3: stackato unbind-service newdb myapp
An existing database can be deleted by deleting the associated service instance:
e.g. on Stackato v3: stackato delete-service couchdb