https://pulumi.com logo
#general
Title
# general
a

able-doctor-68496

07/16/2021, 12:37 AM
I’m working with Pulumi and the S3 backend. I have two Pulumi projects -
infrastructure
and
application
. The
infrastructure
project has a single stack:
internal
. The
application
project has a single stack:
dev-aws
. When I do
pulumi stack ls
in either project, I see both stacks:
Copy code
$ pulumi stack ls
NAME       LAST UPDATE  RESOURCE COUNT
dev-aws    n/a          n/a
internal*  n/a          n/a
That is not what I expect. I can also select (e.g.) the
dev-aws
stack when I’m in the
infrastructure
project. This is clearly a mistake, but it will create a new
dev-aws
stack within the
infrastructure
project when I run
pulumi up
from the
infrastructure
project with the
dev-aws
stack selected. Why is it doing that? Is there some other recommended way to manage multiple projects with the S3 backend?
I’m going to try specifying the backend in the Pulumi.yaml file for each project and see if that works the way I’d expect.
l

little-cartoon-10569

07/16/2021, 12:58 AM
You have two choices: you can specify different S3 backends via the
backend: url:
property (they can be different keys in the same bucket), or discriminiate stacks with projects names.
If you use different backends, you cannot access outputs of either stack from the other.
If you use the same backend then you have one bag of stacks. So you need your stacks to describe which project they belong to, in order to avoid confusion.
Only the Pulumi backend has built-in support for "this stack belongs to that project".
Also, it's the only one that supports organizations.
b

billowy-army-68599

07/16/2021, 3:02 AM
what tenwit said ^^
the general pattern is that people will prefix their stacks with a project name, like
infrastructure.dev
a

able-doctor-68496

07/16/2021, 6:14 AM
Ok, thanks for the explanation. I definitely want to access the infrastructure outputs in the application stacks, so I guess I’ll need to use the naming conventions suggestion.
p

prehistoric-nail-50687

07/16/2021, 9:17 AM
21 Views