Cloud Foundry Service Broker to define Custom User Provided Service Credentials along with tags
Java
Switch branches/tags
Nothing to show
Clone or download
Latest commit a4c1140 May 9, 2017

README.adoc

Cloud Foundry CUPS tagging service broker

This is an approach to generating Cloud Foundry Custom User Provided Service with support for being able to tag such services.

Issue

This service broker tries to provide a solution to a very common issue when deploying an application(esp Spring Boot based) to Cloud Foundry - being able to tag Custom User Provided Services. There are connectors which get activated by the presence of a tag and since tags cannot be set for custom user provided services, it becomes tricky for some connectors to be activated.

How does this project help

This project is a service broker that can set with the json structure of a CUPS by passing information as parameters during service creation. Since it is a normal CF service, tags can be attached to it, but the credentials returned will be whatever the user has set for it.

for eg. consider a CUPS defined this way:

cf cups SERVICE_INSTANCE -p '{"username":"admin","password":"pa55woRD"}'

The same thing can be defined using the broker this way, with two tags attached to it:

cf create-service cups-tagging-service default mycups -c '{"username":"admin","password":"pa55woRD"}' -t "tag1, tag2"

Registering the Service Broker

Create Redis Store

The application is a simple Spring Boot application and uses Redis to store the state, so just create a redis service first,

cf create-service p-redis shared-vm cups-tagging-redis

Push the app:

cf push

Register the Broker

cf create-service-broker cups-tagging-broker none none https://cups-tagging-broker.local.pcfdev.io

Enable Access to the Service

cf enable-service-access cups-tagging-service

Using it with an app

cf create-service cups-tagging-service default mycups -c '{"username":"admin","password":"pa55woRD"}' -t "tag1, tag2"

and bind to the app:

cf bind-service myapp mycups