Managing Service Keys

Page last updated: October 30, 2015

This page assumes you are using cf CLI v6.

This topic describes generation of credentials for service instances for use by external or local clients. For an overview of services, and documentation on other service management operations, see the Services Overview topic. If you are interested in building Services for Cloud Foundry and making them available to end users, see the Custom Services documentation.

Note: Not all services support automated generation of credentials. Some services support credentials through application binding only.

Create a Service Key

Generates credentials for a service instance.

$ cf create-service-key myservice mykey
Creating service key mykey for service instance myservice as [email protected]...
OK

List Service Keys for a Service Instance

$ cf service-keys myservice
Getting service keys for service instance myservice as [email protected]...

name
mykey1
mykey2

Get Credentials for a Service Key

$ cf service-key myservice mykey
Getting key mykey for service instance myservice as [email protected]...

{
  uri: foo://user2:[email protected]/mydb,
  servicename: mydb
}

--guid can be provided to display the API guid for the service key.

$ cf service-key --guid myservice mykey
Getting key mykey for service instance myservice as [email protected]...

e3696fcb-7a8f-437f-8692-436558e45c7b

OK

Delete Service Key

$ cf delete-service-key myservice mykey

Are you sure you want to delete the service key mykey ? y
Deleting service key mykey for service instance myservice as [email protected]...

OK

Add option -f to force deletion without confirmation.

$ cf delete-service-key -f myservice mykey

Deleting service key mykey for service instance myservice as [email protected]...

OK