https://pulumi.com logo
Title
d

damp-school-17708

04/15/2021, 3:21 PM
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

brave-planet-10645

04/15/2021, 3:22 PM
Are you adding the projects to the same bucket?
As in using the same bucket for storage of the stack
d

damp-school-17708

04/15/2021, 3:23 PM
I guess yes, it's the bucket used in
pulumi login
right?
a

abundant-autumn-85033

04/15/2021, 3:27 PM
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

damp-school-17708

04/15/2021, 3:28 PM
yeah the name is definitely unique
a

abundant-autumn-85033

04/15/2021, 3:29 PM
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

bored-oyster-3147

04/15/2021, 3:29 PM
it sounds like you're still logged into the state of the other project
d

damp-school-17708

04/15/2021, 3:29 PM
I am not using pulumi SaaS as backend, I am using my S3 bucket in AWS
b

bored-oyster-3147

04/15/2021, 3:29 PM
when you use a filestate backend like S3 it doesn't differentiate between projects
d

damp-school-17708

04/15/2021, 3:29 PM
so when you switch project do you need to logout every time and log back in?
b

bored-oyster-3147

04/15/2021, 3:29 PM
no
you need to name your stacks with a project scope
d

damp-school-17708

04/15/2021, 3:30 PM
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

bored-oyster-3147

04/15/2021, 3:30 PM
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

damp-school-17708

04/15/2021, 3:31 PM
if we got for the pulumi SaaS that goes away ?
a

abundant-autumn-85033

04/15/2021, 3:31 PM
just for clarity, are you using the same s3 bucket for both projects too? i.e. infra vs func ?
d

damp-school-17708

04/15/2021, 3:31 PM
yep @abundant-autumn-85033
b

bored-oyster-3147

04/15/2021, 3:31 PM
in filestate backends stack names are globally unique in SaaS backend stack names are unique scoped to the project
d

damp-school-17708

04/15/2021, 3:32 PM
🤯
that would explain the situation
a

abundant-autumn-85033

04/15/2021, 3:33 PM
plus you don't get the cool ui 😉
b

bored-oyster-3147

04/15/2021, 3:38 PM
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