Can't expose API host to envVarGroups

Hello,

I’m currently deploying an API and a frontend in a mono repo. I need to expose my API host to my envVarGroups, but I receive the following error when I try:

envVarGroups[0].envVars[0] must have a key and value

Here is my render.yaml file

previewsEnabled: true
services:
  - type: web
    name: api
    runtime: docker
    repo: [hidden]
    region: ohio
    plan: free
    branch: main
    rootDir: backend/api
    numInstances: 1 # optional (defaults to 1)
    healthCheckPath: /
    pullRequestPreviewsEnabled: true

envVarGroups:
  - name: settings
    envVars:
      - key: WEB_HOST
        fromService:
          name: api
          type: web
          property: host

I also tried

envVarGroups:
  - name: settings
    envVars:
      - key: WEB_HOST
        fromService:
          name: api
          type: web
          envVarKey: RENDER_EXTERNAL_URL

which was mentioned in a different topic post, but received the same error mentioned above. Any help is greatly appreciated.

Hi,

The fromService helper is only available on envVars under a service. Unfortunately, the helper isn’t available under envVarGroups.

Alan

1 Like

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