`pulumi stack init` : How can we set in which `pro...
# general
s
pulumi stack init
: How can we set in which
project
the stack will be created in?
Is seems the project is implicitly set by what’s set in the
name
in the nearest
Pulumi.yaml
.?
g
Yep, that’s how it works.
s
That’s not really intuitive, though. The
org/project/stack
semantic is explicit & more obvious. E.g. with
pulumi stack select org/project/stack
.
@gentle-diamond-70147 Am I right that
stack
s are a subpart of a
project
? Or can stacks be in the Pulumi platform without a project?
g
A stack is an instantiation of a project (e.g.
dev
,
staging
,
prod
), so a stack always belongs to a project.
s
I see. Thanks for the clarification.
c
To be frank, this is an area that we are still working to improve the support for across the CLI. (As earlier this year a stack was just identified by
org/stack
, and we later added
org/project/stack
.) So there are a few places where the interpretation of “stack identifier” isn’t quite right. But as you mentioned, if you just use
stackname
the
org
and
project
will be inferred. (By the
Pulumi.yaml
file in the current folder, and who you are logged in as.) Similarly,
org/stack
will infer the
project
.) You can specify the project name when creating a new stack though, e.g.
stack init chrsmith/website-backend/production
. However, you will get an error if the project name (
website-backend
) doesn’t match what is in your Pulumi.yaml file. (Since if we allowed that it would lead to some very bad situations down the line.) So we’re working on making this more seamless, but that’s how it all works. Please don’t hesitate to ask any other questions if things are confusing.
s
@colossal-beach-47527 You mind reviewing my PR #3933? Is there sth. missing?
👀 1
👍🏽 1
Thanks 🙂