Skip to content

Switch from service binding label to tags to read credentials from VCAP_SERVICES #346

@gregorwolf

Description

@gregorwolf

As described in the migration guide from cds-pg to @cap-js/postgres the

service binding label is postgresql-db

that means that if someone wants to use a PostgreSQL directly from a hyperscaler and does provides the credentials using a user provided service (UPS) the connection will not work out of the box. To make the connection work this additional entry in the package.json of the deployer and service module is needed:

  "cds": {
    "requires": {
      "kinds": {
        "postgres": {
          "vcap": {
            "label": "user-provided"
          }
        }
      }
    }
  }

If instead tags would be used to to read credentials from VCAP_SERVICES it would be easier to get them from the UPS. Using the UPS configuration via mta.yaml it's possible to set tags:

      service-tags: ["relational", "database"]

You can find a working in mta.yaml#L127. This tags mimic the tags that the PostgreSQL on SAP BTP, hyperscaler option creates in VCAP_SERVICES:

"tags": ["relational", "database"]

So I would suggest to read VCAP_SERVICES by the tag "database".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions