Hi folks, I’m new to Pulumi, and after a few days ...
# general
p
Hi folks, I’m new to Pulumi, and after a few days of reading the docs, watching various videos, and searching through slack, I’ve not been able to find what the best practice is for the location of the Pulumi projects. In my previous experience, IaC has been located in a separate repo (called something like infrastructure), but I have a feeling there’s a Pulumi way that doesn’t match this. I’ve got a few nodejs microservices (a main API, and a couple of util APIs), and a UI which all live in separate git repos. They’re all independent, and don’t share resources (like db etc), but I was wondering if having the networking side of things (VPC, Security groups etc) as shared. I’ll have 2 stacks for now,
dev
and
prod
but may add more later (test, staging etc). I’m likely to follow this kind of structure for the microservices. It feels like my options are: 1. Create an
infra
folder in each application repo, and manage them as separate entities, but not sure about how to manage shared resources like networking. 2. Create an
infrastructure
repo, and work out how to cross reference the resources in the build & deploy steps in my application repos. 3. Create a monorepo with all the applications in folders, and an
infra
folder to handle the build & deploy 4. Something else I’m missing? 🙂 Can anyone point me to some useful resources on this? Or nudge me in the right direction? Cheers
p
You read through this yet? https://www.pulumi.com/docs/guides/organizing-projects-stacks/ I am still getting my bearings as well, but my understanding is that there are many different workable approaches I am partial to the monorepo (nx in my case)
Copy code
├── apps
│  ├── infra-core
│  ├── ...
│  ├── sweet-app
│  ├── sweet-app-infra
├── libs
│  ├── infra
│  │  ├── modules
│  │  │  ├── aurora-postgres
│  │  │  ├── static-frontend
│  │  │  └── vpc
│  │  ├── data
│  │  │  ├── base.yml
│  │  │  └── prod.yml
│  ├── ...
│  ├── sweet-ui
│  ├── utils
p
Yep, had a good look through that one, and the pages it references. I think I’ve worked it out now, and have setup a project for infra, and one for the application services - will use stack references where needed 👍