This message was deleted.
# general
s
This message was deleted.
b
hey! stack references to work with the open source backends, but because there are no concepts of "organization" with the OSS state storage, you have to set things up a little differently. In your case, you'd have two projects - core - infra when you init the stack, you also want to add a differentiator between prod and dev. So when you create the
core
project, instead of using the stack name
dev
you'll want to call the stack
core.dev
and the infra stack
infra.dev
i don't think I've really explained that well, so happy to answer any questions
g
I think I’m following … So…
1. start a project called core. add three stacks to that project:
core.dev
,
core.test
,
core.prod
2. start a project called infra, add three stacks to that project:
infra.dev
,
infra.test
,
infra.prod
Is that what you’re saying?
Also, the state for all 6 stacks should be kept in the same s3 bucket I assume?
And then finally, if I set things up this way, how do I reference something from say
core.prod
inside the
infra
project?
b
yes that's right!
g
Awesome. Thanks for the help!
b
your stack ref would look like this
Copy code
const stackRef = new pulumi.StackReference("core.dev")
1
the reason I suggest using a dot separator is because it helps you do something like this
Copy code
stack = pulumi.getStack()
env = stack.split(".")
const stackRef = new pulumi.StackReference(`core.${env}`)
(untested code, but hopefully you get the idea!)
1