late-airplane-27955
10/13/2024, 8:37 AMcdk ls
and then deploy one of them using cdk deploy <stack name>
. This was very nice for us especially around managing fleets of kubernetes clusters etc, we would be able to test an update on a single cluster before deploying it to all, since each cluster was its own cdk stack. I'm finding myself a little unsure how to do something similar with pulumi, without having to resort to "cheating". I'd like to contain all our clusters in a single codebase, but I don't necesarily want to deploy a change to all clusters at the same time. Is my only option to create a pulumi "app" per cluster, or is there some easier way of doing this?late-balloon-24601
10/13/2024, 12:20 PMproject/
├─ node_modules/
├─ db-1/
│ ├─ index.ts
│ ├─ Pulumi.dev.yaml
│ ├─ Pulumi.prod.yaml
│ ├─ Pulumi.yaml
├─ db-2/
│ ├─ index.ts
│ ├─ Pulumi.dev.yaml
│ ├─ Pulumi.prod.yaml
│ ├─ Pulumi.yaml
├─ cluster-1/
│ ├─ index.ts
│ ├─ Pulumi.dev.yaml
│ ├─ Pulumi.staging.yaml
│ ├─ Pulumi.prod.yaml
│ ├─ Pulumi.yaml
├─ .gitignore
├─ package.json
├─ README.md
In each Pulumi.yaml
, you can set main: index.ts
so it uses the index in the current folder rather than the entrypoint as defined in package.json
.
Each db/cluster is a separate pulumi 'project', and each project can have multiple stacks (environments).
I'm not sure if this is perfectly applicable to your situation, but thought it might give some ideas on how you can lay stuff out.late-airplane-27955
10/13/2024, 12:23 PMlate-balloon-24601
10/13/2024, 12:28 PMlate-balloon-24601
10/13/2024, 12:31 PMlate-airplane-27955
10/13/2024, 12:33 PMlate-balloon-24601
10/13/2024, 12:34 PMlate-balloon-24601
10/13/2024, 12:35 PMlate-airplane-27955
10/13/2024, 12:37 PMlate-airplane-27955
10/13/2024, 12:38 PMlate-balloon-24601
10/13/2024, 12:40 PM# yaml-language-server: $schema=..
, but pulumi's published schemas are a bit lacking at the moment. I'd really like to see full programmatic control of the stack config without having to go down the automation api pathlate-airplane-27955
10/13/2024, 12:44 PMlate-airplane-27955
10/13/2024, 12:45 PMlate-airplane-27955
10/13/2024, 12:45 PMlate-balloon-24601
10/13/2024, 12:47 PMconst goodProjectName = Environment.expectedProjectNameRegex.test(this.projectName)
if (!goodProjectName) {
void log.warn(`The project name (${this.projectName}) does not follow the expected production project format of {servicename}-{scope}. This may cause issues with dynamic imports.`)
}
blehhh!late-airplane-27955
10/13/2024, 12:50 PMlate-airplane-27955
10/13/2024, 12:52 PMlate-balloon-24601
10/13/2024, 12:53 PMlate-airplane-27955
10/13/2024, 12:53 PMlate-balloon-24601
10/13/2024, 12:54 PMlate-airplane-27955
10/13/2024, 12:56 PMlate-balloon-24601
10/13/2024, 12:57 PM