0

I have an app in Pivotal Cloud Foundry bound to Hashicorp Vault Service Broker service. The following environment variables are injected into the app due to this binding:

 "system_env_json" : {
    "VCAP_SERVICES" : {
        "hashicorp-vault" : [{
                "credentials" : {
                    "address" : "XXX",
                    "auth" : {
                        "accessor" : "XXX",
                        "token" : "XXX"
                    },
                }
            }
        ]
    }
}

I set up the bootstrap.yml as follows:

spring:
  profiles: "cloud"
  cloud:
    vault:
      authentication: TOKEN
      token: {vcap.services.my-svc-name.credentials.auth.token}       uri:{vcap.services.my-svc-name.credentials.address}
      generic:
        backend: {vcap.services.my-svc-name.credentials.auth.token} </pre></div><!-- /wp:codemirror-blocks/code-block --> <!-- wp:paragraph -->I get the following error:<!-- /wp:paragraph --> <!-- wp:paragraph --><strong>Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 1:{vcap.services.my-svc-name.credentials.address}

Note: I've tried surrounding the injected variables with single quotes, double quotes, and also tried using 'hashicorp-vault' in lieu of 'my-svc-name' ex '${vcap.services.hashicorp-vault.credentials.auth.token}'

Anonymous Asked question May 14, 2021