spring-attic / cloudfoundry-service-broker

Sample project for Spring Cloud - Cloud Foundry Service Broker
Apache License 2.0
41 stars 90 forks source link

Use externalized configuration to define service broker catalog #11

Closed s-bortolussi closed 8 years ago

s-bortolussi commented 8 years ago

For catalog management, spring-boot-cf-service-broker provides a default implementation that requires the broker to just provide an implementation of a Catalog bean. An improvement would be to enable the use of externalized configuration (properties files, YAML files, environment variables or command-line arguments) to set Catalog bean attributes.

Then, a very basic catalog definition using env variables would be :

$ export SERVICES_DEFINITIONS[MONGO_DB]_ID=mongodb-service-broker 
$ export SERVICES_DEFINITIONS[MONGO_DB]_NAME=Mongo DB
$ export SERVICES_DEFINITIONS[MONGO_DB]_DESCRIPTION=A simple MongoDB service broker implementation
$ export SERVICES_DEFINITIONS[MONGO_DB]_PLANS[DEFAULT]_ID=mongo-plan
$ export SERVICES_DEFINITIONS[MONGO_DB]_PLANS[DEFAULT]_NAME=Default Mongo Plan
$ export SERVICES_DEFINITIONS[MONGO_DB]_PLANS[DEFAULT]_DESCRIPTION=This is a default mongo plan. All services are created equally

This feature can be extended by enabling a remote externalized configuration

s-bortolussi commented 8 years ago

Moved to spring-cloud/spring-cloud-cloudfoundry-service-broker repo