https://pulumi.com logo
Title
h

hundreds-musician-51496

11/04/2020, 11:04 PM
It would be really nice if the output type of my pulumi program could be preserved on the stack object's outputs property, or in some other way I could make make a static guarantee about outputs returned. (thread)
My pulumi program (
pulumiProgram
) has the type
(string, string) => Promise<pulumi.Output<DocOutputs>>
, where
DocOutput
is a simple object I previously serialized to JSON (its used as a stack output). I've shoved that into `InlineProgramArgs`:
const args: InlineProgramArgs = {
    program: pulumiProgram
  };
It would be awsome if
stack.outputs
had the type
DocOutputs
after the below:
const stack = await LocalWorkspace.createOrSelectStack(args, { workDir: "." });
Or if
upRes.outputs
had that type after updating:
const upRes = await stack.up({ onOutput: <http://console.info|console.info> });
Understandably that's hard as
OutputMap
has special structure
l

lemon-agent-27707

11/04/2020, 11:13 PM
Agree that the weak typing here leaves something to be desired. It may be possible to infer the type from the program, but I'd need to tinker with it. Would you mind opening an issue with what you described above?
h

hundreds-musician-51496

11/04/2020, 11:14 PM
No problem!