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

rhythmic-hair-33677

12/22/2019, 5:33 AM
Can a stack have several projects? It seems a little odd to see already existing stacks suggested for new projects (my understanding of a project is just an index file and a mapped runtime (i.e. nodejs).
w

white-balloon-205

12/22/2019, 5:35 AM
No. A stack is an instance of one project.
It seems a little odd to see already existing stacks suggested for new projects
Where are you seeing this? As written, that indeed seems odd.
my understanding of a project is just an index file and a mapped runtime (i.e. nodejs).
That's right - a project is a
Pulumi.yaml
file (which includes what runtime to use, a name for the project, and optionally a pointer to a non-default location for the entrypoint to load using the language runtime).
r

rhythmic-hair-33677

12/22/2019, 6:06 AM
When running
pulumi up
on a new project (or one without an associated stack) a prompt to select a stack is given. It defaults to an already-associated stack. I always scroll down and type a new name.
w

white-balloon-205

12/22/2019, 6:07 AM
Oh - is the project name the same across these? The identity of the project is based on project name - and if you have multiple projects with the same "name", you may see this?
r

rhythmic-hair-33677

12/22/2019, 6:29 AM
No. The project names are all different. I have a tree like this: ``````
Copy code
00-base/
  Pulumi.yaml
01-identity/
  Pulumi.yaml
02-platform/
  Pulumi.yaml
w

white-balloon-205

12/22/2019, 7:28 AM
And just to make sure - are the
name
fields in those
Pulumi.yaml
files each different?
e

elegant-dress-88912

12/22/2019, 7:39 AM
@white-balloon-205 same issue is described here: https://github.com/pulumi/pulumi/issues/2814#issuecomment-512723246
that happens for gcs and s3 backends (when projects share the same S3/GCS path for state)
same path is used to be able to use StackReference which works well only with pulumi service backend where you can refer to stack by org/project/stack. For GCS/S3 you can refer only by stack name and both stack states should be under the same path
w

white-balloon-205

12/22/2019, 7:54 AM
Ahh - yes - if this is a local/s3/GCS backend that could definitely be the issue. FWIW - this issue is more directly tracking fixing this: https://github.com/pulumi/pulumi/issues/2522
e

elegant-dress-88912

12/22/2019, 7:55 AM
thanks @white-balloon-205 , will follow it
side note: it's better to make
backend
to be a stack property, not project property.
w

white-balloon-205

12/22/2019, 8:01 AM
Agreed - backend should very much be associated with a stack not a project.