This message was deleted.
# general
s
This message was deleted.
l
If you mean pulumi.Config, you can't share config across projects using project or stack yaml files. pulumi.Config is usually used for per-project and per-stack configuration: if you have wider configuration (whole-of-business, for example) you may prefer to use a vault of some sort.
☝️ 1
f
Yes on both 🙂 A project is defined by the presence of a
Pulumi.yaml
file. And the best practice is to share config needed for dependent stacks with each other through stack references. That said, if there is higher level config that you want to set across projects.. you have the full power of programming languages available so you can certainly get creative here. I’ve seen folks even go so far as create a package that simply has application wide configuration. You could also create a project/stack just for common configuration settings and consume that as a stack reference for any new project stack that would need the common configuration.
✔️ 1
a
Thanks for the details, that's helpful.
In terms of running the specific projects/stacks, is there any mechanism for specifying which project and stack to run from, or is that just dependent on which directory you are in?
f
For the project it’s dependent on which directory you’re in or pointed to using `--cwd`… for the stack it’s dependent on what stack was used last. This is tracked in
~/.pulumi/workspaces
. In automation it’s common to run
pulumi stack select [desired stack]
as a first step.
There’s also the
-s
option that you can set to operate on a specific stack as well.
a
Thanks, knowing about the
-s
and
--cwd
options helps.
f
If you are using a cloud storage backend, I've found that stack refs doens't really work across projects. So I ended up having just one project but a stack for each package in my mono repo (using yarn workspaces)