How to pass the deployment URL from one app to another

Hello.

I’m creating a waypoint deployment with a very common scenario, an API and a front-end app.

I’ve tried this locally, creating the deployments with Docker, because both application was Dockerised, and the waypoint.hcl is similar to this:

project = "test"

app "api" {
    path = "./api"

    build {
        use "docker" {
            dockerfile = "_docker/Dockerfile"
            context = "api/_docker"
        }
    }

    deploy {
        use "docker" {
            service_port = 80
            binds = ["${path.project}/api:/app"]
            extra_ports = [3306]
            static_environment = {
                  "MYSQL_DB": "xxxx",
                  "MYSQL_PASS": "xxxx"
            }
        }
    }
}

app "front-end" {
    path = "./front-end"

    build {
        use "docker" {}
    }

    deploy {
        use "docker" {
            service_port = 4200
            binds = ["${path.project}/front-end:/front-end/app"]
        }
    }
}

When I run this with waypoint up I’m able to access to the URL generated for the front-end project an everything is working. But it’s working because I have harcoded in the API and front-end configuration the URL of both. This configuration can be set up with environment variables, but I’m not sure how to set the value of them with the URL that Waypoint assigns. So, is there any way to assign them in the static_environment block?

Thanks!

Not exactly the answer you are looking for, but judging from Multi-App deployment use output attribute from app A as input for app B - #2 by evanphx inter app config exchange is to be done through the platform.