This service broker shares a PostgreSQL amongst many users via the Open Service Broker API.
There are important environment variables that should be overriden inside the manifest.yml file:
BROKER_USERNAME
andBROKER_PASSWORD
are required to setup HTTP Basic Auth to the broker API.PG_SOURCE
- URL used for connection to a PostgreSQL database instance. Can be customized according to this library.
-
Clone this repository, and
cd
into it. -
Target the space you want to deploy the broker to.
$ cf target -o <org> -s <space>
-
The configuration is entirely read from environment variables. Edit the manifest.yml according to your environment.
-
Deploy the broker as an application.
$ cf push
-
$ cf create-service-broker shared-postgresql-broker $BROKER_USERNAME $BROKER_PASSWORD $APP-URL
-
Enable Access to Service Plans.
$ cf enable-service-access a.postgresql
All credentials stored in the VCAP_SERVICES
environment variable with the JSON key a.postgresql
.
-
$ cf create-service a.postgresql standard my-postgresql
-
$ cf bind-service my-app my-postgresql
Copyright 2017 Andrei Krasnitski
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.