Firstly, let me get this out of the way. There is no hard and fast rule or requirement for structuring Pulumi projects. Now that that's out of the way, let's look at couple of approaches and compare them with each other. Hopefully, you'll come out of this a bit clearer on what you want to do for your projects.
What Are Projects?
Projects are a grouping of stacks. You can have as many stacks as you want in a project. Projects define the runtime
environment and other settings that apply to all the stacks contained within. There is no limit to the number of projects you can have in your account either. The project configuration settings exist in the Pulumi.yaml
which will always be created regardless of whether or not you have per-stack configuration. On the other hand, the per-stack configuration file which takes the form Pulumi.<stack name>.yaml
will only be created by the Pulumi CLI when you run the pulumi config set ...
command for the first time for a stack.
The project configuration file is the entrypoint for the CLI to understand some basic things about your project. See the full configuration reference for Pulumi.yaml
to learn about all the available options.