Hi, how to import stack output from one project to...
# general
d
Hi, how to import stack output from one project to another project using pulumi cli? Not using pulumi cloud
e
I think they have to be in one org (and in one state storage, accordingly) and then you do that through stack reference:
Copy code
const reposStack = new pulumi.StackReference('organization/repos/dev')
const repo = reposStack.getOutput("repo") as pulumi.Output<Repository>
Here there's a project called
repos
and a stack called
dev
, and the snippet above is in another project. Actually, scratch what I said about organization... here we just use generic placeholder
organization
since no actual org is defined.
d
Thanks @eager-noon-15510