I've been bashing my head for two days on this an...
# general
d
I've been bashing my head for two days on this and I still don't understand the issue. (https://pulumi-community.slack.com/archives/C84L4E3N1/p1618418077072900) Even if I create a completely new project (from the template) and then I do a pulumi up (new folder, etc, the only 'configured' thing is that I am logged in pulumi (S3/AWS)) the new project tries to delete all my resources that are in another project. Is there really no other way to get out of this situation? As we are not yet in production with our code I am tempted TBH to start from scratch but before I do thats I was wondering if I am doing something completely stupid with the tooling. I don't see why you can't just start as many projects as you want and keep adding state.
b
Are you adding the projects to the same bucket?
As in using the same bucket for storage of the stack
d
I guess yes, it's the bucket used in
pulumi login
right?
a
The Pulumi.yaml file name for each project needs to be unique. so like 'project-infra' vs 'project-func1' etc. If they have all the same name, then when you do 'pulumi up' against a stack also with the samee name in function, it will think its the other project. make sense?
d
yeah the name is definitely unique
a
when you do the pulumi up, you get the livepreview url, it should be app.pulumi.com/<pulumilogin>/<projectname>/<stackname>/previews/guid - what does it look like when you do it on each of them?
b
it sounds like you're still logged into the state of the other project
d
I am not using pulumi SaaS as backend, I am using my S3 bucket in AWS
b
when you use a filestate backend like S3 it doesn't differentiate between projects
d
so when you switch project do you need to logout every time and log back in?
b
no
you need to name your stacks with a project scope
d
I see that's also what the pulumi up is doing, like if I do UP on my 'functions' projects it tempts to create functions-dev, etc for the otehrs
b
if you are using a single bucket as state for all your project then your project name is
projectName
and your stack names should be
projectName-dev
or
projectName-prod
d
if we got for the pulumi SaaS that goes away ?
a
just for clarity, are you using the same s3 bucket for both projects too? i.e. infra vs func ?
d
yep @abundant-autumn-85033
b
in filestate backends stack names are globally unique in SaaS backend stack names are unique scoped to the project
d
🤯
that would explain the situation
a
plus you don't get the cool ui 😉
b
I believe this is the most relevant issue for this: https://github.com/pulumi/pulumi/issues/2522 and this is a meta issue for achieving parity across backends and providing support for more backends: https://github.com/pulumi/pulumi/issues/4605