Reference service external URL in render.yaml

I’m deploying an application consisting in:

  • a backend (web service with runtime python)
  • a frontend (web service with runtime static)

The idea is to setup a route in the frontend using the backend as a destination.
Setting it up manually in the dashboard works as hardcoding the backend url as the route destination, in the render.yaml file.

This URL is now known before deploying the blueprint and this is not possible to know the value in advance.
Is there a way to reference the generated url of a deployed web service?

Hi,

You may be able to utilize the envVarKey attribute on your static site declaration, with the RENDER_EXTERNAL_HOSTNAME environment variable e.g.:

...
envVars:
  - key: BACKEND_URL
    fromService:
      type: web
      name: backend-service-name
      envVarKey: RENDER_EXTERNAL_HOSTNAME

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.