Projects and stacks
imulup works on projects. A project is one directory with a Pulumi.yaml, plus one stack: network with dev
is a different project from network with prod. Each project is planned, applied and locked on its own.
Without imulup.yaml
Section titled “Without imulup.yaml”Repositories don’t need any imulup configuration. For each file the PR modifies, imulup walks up the directory tree
to the nearest Pulumi.yaml. It then plans every stack that has a Pulumi.<stack>.yaml in that directory.
.├── network/│ ├── Pulumi.yaml│ ├── Pulumi.dev.yaml│ ├── Pulumi.prod.yaml│ └── index.ts ← modified: plans network:dev and network:prod└── dns/ ├── Pulumi.yaml ├── Pulumi.prod.yaml └── zones.tsAutodetected projects are named dir:stack, such as network:dev, and run the default workflow: just
pulumi preview and pulumi up, with no dependency install. A stack that has no Pulumi.<stack>.yaml (because all
its config is in Pulumi Cloud, say) isn’t detected. List it in imulup.yaml instead.
With imulup.yaml
Section titled “With imulup.yaml”Put an imulup.yaml (or imulup.yml) at the repository root to list projects explicitly. Once it exists, only the
listed projects are planned. A file with version: 1 and no projects: plans nothing.
version: 1projects: - name: network-dev dir: network stack: dev workflow: node
- name: network-prod dir: network stack: prod workflow: node apply_requirements: [approved, mergeable] autoplan: when_modified: - "**/*.ts" - "Pulumi.yaml" - "Pulumi.prod.yaml" - "package*.json" - "../shared/**"
- name: dns dir: dns stack: prod autoplan: enabled: false
workflows: node: plan: steps: - run: npm ci - preview apply: steps: - run: npm ci - upnameis optional. It gives the project a short name for-pin comments. Without it, the project isdir:stack.diris relative to the repo root..is the root itself.autoplan.when_modifieddecides whether a PR modifies the project. The globs are relative todirand default to["**/*"]. They can reach outside it, like../shared/**, but not outside the repository.autoplan.enabled: falsestops automatic plans for the project. A bareimulup planstill plans it if it’s modified, and so doesimulup plan -p dns.workflownames a workflow underworkflows:. See Workflows.
The full schema is in the imulup.yaml reference.
Several stacks and projects in one PR
Section titled “Several stacks and projects in one PR”A PR that touches several projects gets one plan comment covering all of them. Projects run one after another, and each takes its own lock, so one locked or failing project doesn’t stop the rest.
imulup apply with no options then applies every project with a successful plan. To apply in a set order, such as
dev before prod, apply them one at a time:
imulup apply -p network-devimulup apply -p network-prodMonorepos
Section titled “Monorepos”For a repository with many projects, imulup.yaml keeps plans focused:
- Use narrow
when_modifiedglobs so a change to one service doesn’t plan everything. - Point shared code at its users with globs like
../lib/**. - Set
autoplan: {enabled: false}on rarely changed or expensive stacks, and plan them on demand.