Hi all, Bit of a long post, but I am trying to figure out the best way to organize a dynamic set of Pulumi projects and stacks.
I am planning to use Pulumi to deploy resources to Kubernetes and cloud providers on behalf of our customers. Some of our customers pay us to manage their infrastructure, and some of them prefer to manage it themselves.
The first group deploy workloads to infrastructure that we manage, while the second group will need to execute pulumi projects using their own cloud credentials.
There are serveral apps and microservices that customers will want to deploy, and a few of these will be deployed multiple times per customer. A dashboard app is first deployed for a customer. The dashboard will make use of the pulumi automation API to deploy additional apps and microservices at the customers request.
I am not sure how best to organize the projects and stacks in Pulumi.
Option 1: One project per customer workload, with one stack per environment.
/my-organization/infra/qa (for our infrastructure)
/my-organization/infra/prod (for our infrastructure)
/my-organization/customer-a-dashboard/qa
/my-organization/customer-a-dashboard/prod
/my-organization/customer-a-app1/qa
/my-organization/customer-a-app1/prod
/my-organization/customer-a-app2/qa
/my-organization/customer-a-app2/prod
/my-organization/customer-b-app1/qa
/my-organization/customer-b-app1/prod
/my-organization/customer-b-app2/qa
/my-organization/customer-b-app2/prod
Each time a customer deploys a new app, a new project would be created.
When a customer removes an app, the project would be destroyed.
Option 2: One project per customer, with one stack per environment.
/my-organization/infra/qa (for our infrastructure)
/my-organization/infra/prod (for our infrastructure)
/my-organization/customer-a/qa
/my-organization/customer-a/prod
/my-organization/customer-b/qa
/my-organization/customer-b/prod