icy-dress-83371
03/24/2021, 3:31 PMpulumi login --local
. These two projects are in different folders, with different yaml files. Each had their own stack created, but when I say pulumi stack ls
in one of the projects folders, I seem to get both stacks accross multiple projects. I noticed this only because I tried to name the stack in both projects "dev". Am I doing something wrong here, or is this a byproduct of using local login or something?millions-furniture-75402
03/24/2021, 3:37 PMPulumi.yaml
look the same in both projects? This file contains the project name.bored-oyster-3147
03/24/2021, 3:56 PMStackReference
stacks that are in the same project
⢠OR, prefix your stack names with the project name. I.E. project foo
may have stacks foo.beta
and foo.prod
icy-dress-83371
03/24/2021, 4:25 PM~/.pulumi/stacks/
pulumi cannot differentiate them on a project level? These are mostly just local testing at this point anyways, my plan is to use blob storage for state as I used to with terraform, so I guess with that, this problem would solve itself?bored-oyster-3147
03/24/2021, 4:26 PMStackReferences
so we just place all projects in their own directory in our S3 bucket and that works for us.icy-dress-83371
03/24/2021, 4:27 PMbored-oyster-3147
03/24/2021, 4:28 PMicy-dress-83371
03/24/2021, 4:28 PMbored-oyster-3147
03/24/2021, 4:29 PMs3://{bucketName}/{projectName}/
pulumi login
usage. Start specifying your backend in the project.yaml
. Because as you discovered when you use pulumi login
it sets that file state backend as your current backend in the credentials.json
file in your user directory and then it is very easy to forget that it will preserve that login across directories and pollute your backendicy-dress-83371
03/24/2021, 4:38 PMbored-oyster-3147
03/24/2021, 5:16 PMbackend/url
parameter that you can set.icy-dress-83371
03/24/2021, 5:19 PMbored-oyster-3147
03/24/2021, 5:44 PMpulumi login ...
in one pulumi project directory, and then cd
to another project directory and forget that file state backends don't differentiate and that I need to pulumi login ..
again. Me setting the backend/url
in the project.yaml
is my way of not causing issues when I'm developing locally. In a pipeline, this is a non-issue because you can just have it pulumi login
everytime - or in automation API you can put the backend/url
in the project.yaml
and just set your ENV vars on the workspace.
But locally, if those environment vars are required for the azure blob backend, than my recommendation to ditch the pulumi login usage wouldn't work for you - because you also need to remember to change the values of those ENV vars and those can't be set in the YAML files.
Unless of course all of your azure blob backends use the same ENV var values, in which case just setting the backend/url
with the project name suffix in each project YAML will be fine because you don't ever need to change the ENV vars.icy-dress-83371
03/24/2021, 6:44 PM