Search code examples
cloud-foundryswisscomdev

Bind a service to two different app spaces in cloudfoundry


Is it possible to bind a service (i.e. MariaDB) to apps in different spaces? How can I achieve it if I want to use the same database for two different spaces?


Solution

  • I tried the solution from https://docs-cloudfoundry-staging.cfapps.io/devguide/services/sharing-instances.html. If I run the first command I get the following error:

    $ cf enable-feature-flag service_instance_sharing
        Server error, status code: 403, error code: 10003, message: You are not authorized to perform the requested action
    

    The second command works and now I can see the service in the space B on the dashboard.

    $ cf share-service SERVICE-INSTANCE -s OTHER-SPACE [-o OTHER-ORG] 
    

    Note: if I click on the service on the dashboard it says: This is a shared service. It is accessible only in the space it was shared from. The service is also shown greyed out.