Question about organizing Pulumi projects & st...
# general
g
Question about organizing Pulumi projects & stacks. If we wanted to build out our infra using a simpler project/stack organization at first (1 project, and 1 stack for each environment, Dev/Staging/Prod), would we be able to migrate to a more modular setup at a later time? It would be nice to separate resources that are expected to change often from the resources that are not, but we don't necessarily want to take on that extra complexity up front.
👍 1
c
I can’t say there aren’t any other solutions, but this will be a nightmare to move to a modular setup in the future. You would have to do a lot of work by manually manipulating the state.
I would highly advise a single git repo if you want to keep it simpler, but have multiple pulumi projects within it. 1 project per app, and 1 stack per environment.
b
yep agree with the above ^^
g
Thanks for the insight -- it makes sense to break out infra for separate apps, but I'm working on a single platform/system/backend at the moment. Is it a best practice to break out things like the network layer, or monitoring layer into separate projects, even if they are part of the same backend?
c
I group everything by application. For us an application = a separate repository. I do highly recommend you do this. You do NOT want a huge pulumi project as it will be very slow to work with when applying changes.
👍 1
I would also definitely separate out stuff like VPCs and such, because you don’t want to be touching that when running changes such as deploying a new version of your application. Critical pieces of the infrastructure need to be worked on with even more care, and it’s best to keep those pieces separated IMO.
g
Thank you @cool-egg-852 really appreciate it!
c
No problem.