pulumi-cloud
pulumi-cloud copied to clipboard
Allow `Input<T>` on most/all input parameters on Service and other APIs
A concrete example from a user was the Docker build args parameter to new Service(). The following code doesn't work currently, but we should be able to support this:
export let apiEndpoint = deployment.invokeUrl.apply(url => url + deployment.stageName);
let nginxService = new cloudAws.Service("nginx", {
containers: {
nginx: {
build: {
context: "./nginx",
args: {
"API_URL": apiEndpoint,
"FRONTEND_URL": frontendUrl
}
},
memory: 256,
ports: [{port: 443, external: true, protocol: "https"}]
}
},
replicas: 3
});
A other concrete case that a customer ran into - allowing image to be an Input<string> so that it can be composed with new docker.Image(...) more easily.
This was fixed for image: with https://github.com/pulumi/pulumi-cloud/pull/660. We'll tackle others in M20.
This is non-trivial currently due to the fact that build-args are used as part of our computation of the repository name we want to generate.
Potential solutions currently are:
- remove build-args from repo-name genertion. though this might mean potential collisions of docker builds where the args are different.
- allow build-args to be computed, but require the user to supply a repository-name option themselves if they are computed.
- Something else?
@lukehoban Any thoughts here on a preferred direction to go? Is there another option you think we could potentially take here?
Another approach we're taking is simply to remove the cachign layers provided here (i.e. we cache multiple docker builds that have the exact same build comamnd). With the knowledge that this means that consumers that want this sort of non-rebuilding logic would need to pull out that caching themselves.