I would like to push a Cloud Foundry app that needs to bind to a service that requires additional parameters. I found docs on binding services with arbitrary parameters using cf bind-service
at the command line, and I've seen elsewhere how to do a simple binding using a manifest.yml
file. However, I don't see how to add arbitrary parameters for a service binding in a manifest file. How can that be done?
The bind-service
approach is done as:
cf bind-service APP_NAME SERVICE_INSTANCE -c '{"role":"read-only"}'
But I'd like to be able to do it in the manifest, something like the hypothetical below (but which doesn't work):
services:
- service_instance:
role: read-only
I'd like to give an update on this old question as I've just bumped on the same issue and the answer nowadays is different. Things have evolved and using cf CLI V7 we are now able to pass in parameters for services within manifest files. Here is the syntax:
---
applications:
- name: my-app
services:
- name: my-service1
parameters:
foo: bar
herp: derp
- name: my-service2
parameters:
foo: bar
and below is a real example:
---
applications:
- name: order-service
path: order-service/build/libs/order-service-0.0.1.jar
services:
- mysql
- name: gateway
parameters:
routes: [{"path": "/order-service/**"}]
The documentation on Cloud Foundry application binding states that arbitrary parameters are not currently supported in manifests:
As an alternative to binding a service instance after pushing an application, you can use the application manifest to bind the service instance during push. As of cf CLI v6.12.1, Arbitrary Parameters are not supported in application manifests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With