https://pulumi.com logo
#getting-started
Title
# getting-started
l

limited-telephone-38538

08/18/2023, 8:24 PM
Hey folks, is it possible to access local Pulumi outputs from an application that isn’t a Pulumi project? Trying to use the outputs of the infrastructure to run some automated tests dynamically. Doing the following gives me an error of `TypeError: Cannot read properties of undefined (reading 'mainVMIPAddress')`:
Copy code
const infrastructureStack = new pulumi.StackReference("organization/infrastructure/dev");
    const mainVMIPAddress = (await infrastructureStack.getOutputDetails("mainVMIPAddress")).value as string;
g

green-stone-37839

08/18/2023, 8:27 PM
Not directly using
StackReference
outside the context of a Pulumi project. Two options would be to use the Pulumi CLI to access the outputs of the desired project using a bash script or you could also use the Automation API. The latter seems possibly a better choice for you as you appear to want to do this in typsecript code.
l

limited-telephone-38538

08/18/2023, 8:36 PM
That worked, thank you!
g

green-stone-37839

08/18/2023, 8:47 PM
👍