Skip to content

How to Make a Shareable Service Instance

Elena Sharma edited this page Nov 17, 2017 · 6 revisions

Setup

  1. Create org org, spaces space1 and space2
  2. Log in as admin on space space1
  3. cf enable-feature-flag service_instance_sharing
  4. In cats/assets/service_broker, modify the data.json file as follows:
"requires": [
  "route_forwarding" <----- REMOVE
],
...
"metadata": {
"shareable": true    <----- ADD
}

Deploy Broker and Create Service

  1. ruby setup-service-broker.rb async-broker TARGET.capi.land
  2. cf marketplace to get service name FSNAME
  3. cf cs FSNAME fake-plan fs1

Verify Unshared Behavior

  1. cf create-user joe joe
  2. cf set-space-role joe org space2 SpaceDeveloper
  3. cf auth joe joe
  4. cf target -o org -s space2
  5. cf service fs1 should not find service fs1

Share the Service Instance

  1. cf auth admin ADMINPASSWORD # or target_cf
  2. cf target -o org -s space1
  3. service="$(cf service fs1 --guid)"
  4. space2="$(cf space space2 --guid)"
  5. cf curl -X POST /v3/service_instances/$service/relationships/shared_spaces \ -d '{"data": [ { "guid": "'$space2'" } ] }'

Verify Shared Behavior

  1. cf auth joe joe
  2. cf target -o org -s space2
  3. cf service fs1 should give details on service fs1
Clone this wiki locally