How to access config variables from other sections in HCL?

I’ve been trying to figure out how I could do something like the following:

app "frontend" {
  config {
    env = {
      PORT = 3001
    }
  }
...
  release {
    use "kubernetes" {
      load_balancer = true
      ports = [
        {
          port: 8080,
          target_port: app.frontend.config.env.PORT
        }
      ]
    }
  }

I’ve looked at the waypoint Variables docs and it only refers to a few predefined variables. And the config section doesn’t really describe how these configurations can be accessed as variables. The generic HCL syntax docs refer to a var. but I am not sure if that is relevant here.

We are working to support this in 0.4.0, see here.

1 Like