https://pulumi.com logo
#automation-api
Title
# automation-api
b

better-shampoo-48884

03/25/2021, 12:52 PM
Does anyone have an example where they have automation reference a stack in a different project? Ideally such that that project's pulumi.yaml and stack config are not accessible to the automation? To put this in context: I have a project called "baseline-infra" which is your traditional pull-request based IaC with automation pipeline. Next, I'm going to have a k8s-components which, ideally, should have stacks which reference their reciprocal stacks.. i.e. Baseline-Infra::dev.infra.project1 is the source stack for k8s-components::dev.k8s.project1 .. if it helps, both projects will keep their state in the same azure blob.
l

lemon-agent-27707

03/25/2021, 12:59 PM
g

gifted-student-18589

03/25/2021, 1:00 PM
BTW stack references can only be used when using Pulumi Service, or can be used for example with S3 as a backend?
b

better-shampoo-48884

03/25/2021, 1:03 PM
there don't seem to be any options indicating how it would be able to retrieve a stack from a specified backend..
b

brave-planet-10645

03/25/2021, 1:03 PM
You can use stack references from any backend. A user wrote a blog post on this recently which I'm just hunting out
👀 1
b

better-shampoo-48884

03/25/2021, 1:05 PM
yup - read that - just didn't see how it magically figured out where that stack was located.. I'm presuming that the stack location MUST be in the same backend (whatever that might be) as the current project configuration right?
b

brave-planet-10645

03/25/2021, 1:06 PM
Yes, it has to be in the same backend
b

better-shampoo-48884

03/25/2021, 1:07 PM
well, might as well test it out 🙂 /me crosses fingers that I don't magically wipe things out 😄
g

gifted-student-18589

03/25/2021, 1:07 PM
awesome stuff
thanks for sharing
@brave-planet-10645
b

brave-planet-10645

03/25/2021, 1:08 PM
🙂
So the stack reference is read only. You're basically reading in the outputs from other stacks
g

gifted-student-18589

03/25/2021, 1:10 PM
great, totally reasonable
b

brave-planet-10645

03/25/2021, 1:11 PM
Also, if you change the value of an output, the "reader" stack won't get the new value until you run pulumi up on that one
g

gifted-student-18589

03/25/2021, 1:13 PM
great 👍