It would be really nice if the output type of my p...
# automation-api
h
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`:
Copy code
const args: InlineProgramArgs = {
    program: pulumiProgram
  };
It would be awsome if
stack.outputs
had the type
DocOutputs
after the below:
Copy code
const stack = await LocalWorkspace.createOrSelectStack(args, { workDir: "." });
Or if
upRes.outputs
had that type after updating:
Copy code
const upRes = await stack.up({ onOutput: <http://console.info|console.info> });
Understandably that's hard as
OutputMap
has special structure
l
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
No problem!