I guess this is not currently possible: <https://g...
# automation-api
i
I guess this is not currently possible: https://github.com/pulumi/pulumi/issues/9112 Hopefully I can find a workaround
l
You can do this via automation api. Something along the lines of:
Copy code
// Create our stack 
    const args: InlineProgramArgs = {
        stackName: "reference-stack",
        projectName: "reference-project",
        program: async () =>{} // dummy program

    refStack = await LocalWorkspace.selectStack(args);
    refValue = stack.getOutput("key")

    destStack.setConfig("key", refValue)
    desStack.up();
    };
basically: 1. select the stack to read the reference from 2. read the output value you need 3. select the destination stack 4. set the config value with the output of (2) 5. run an update
i
Hey Evan, I'm giving this a go but typescript tells me there is no
stack.getOutput
l
Sorry the method is actually stack.outputs() and you’ll need to look in the returned map for the property you want.
i
that works! thank you 🙂 is it secure when using it with secrets?
l
It uses the Pulumi CLI and Pulumi Cloud APIs under the hood, so very secure. However it is up to you to handle the values securely once you retrieve them. No different than using the CLI.