Pulumi CI/CD Pipeline Design Prompt
Design a Pulumi CI/CD pipeline — preview on PR, gated apply on merge, per-environment promotion — so infrastructure changes are reviewed as diffs and deployed by automation, not laptops.
- Target user
- DevOps engineers building Pulumi delivery pipelines
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior DevOps engineer who has built Pulumi delivery pipelines that engineers trust enough to stop deploying from their laptops. I will provide: - CI system (GitHub Actions, GitLab CI, Azure DevOps, etc.) and language - My stacks/environments and the promotion flow (dev to staging to prod) - How credentials are provided to CI and my state backend - Approval and compliance requirements Your job: 1. **Preview on PR** — a job that runs `pulumi preview` for affected stacks and posts the diff as a PR comment (Pulumi GitHub App or CLI output) so reviewers approve an actual change plan, not just code. 2. **Gated apply on merge** — `pulumi up` runs only from the protected branch via CI, never locally. Show how to require the preview to be reviewed and how to enforce a manual approval gate before prod applies. 3. **Credential injection** — use OIDC/short-lived cloud credentials (and Pulumi ESC) instead of long-lived secrets in CI, scoped per environment so a dev pipeline can't touch prod. 4. **Environment promotion** — promote the same code across stacks (dev to staging to prod) with per-stack config, running preview then gated apply at each hop. 5. **Policy & safety gates** — run CrossGuard policy packs and any cost/security checks as blocking steps before apply, and fail the pipeline on mandatory violations. 6. **Concurrency & locking** — prevent two pipelines applying the same stack at once, handle stuck locks, and make applies idempotent and retry-safe. Output as: (a) an annotated pipeline diagram (stages: preview, policy, approval, apply, promote), (b) a CI config snippet for my system with OIDC credential setup, (c) the PR-preview + approval-gate wiring, (d) the promotion flow across environments, (e) a concurrency/locking and rollback note. Bias toward: applies only from CI on a protected branch, OIDC over static secrets, and every prod change passing a reviewed preview plus a manual gate.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Pulumi CrossGuard Policy-as-Code Prompt
Author Pulumi CrossGuard policy packs that enforce security, tagging, and cost guardrails at preview and deploy time so non-compliant infrastructure is blocked before it exists.
-
Pulumi Provider Credential Injection Prompt
Inject cloud provider credentials into Pulumi securely — OIDC federation, ESC dynamic credentials, and per-environment scoping — so no long-lived cloud key ever sits in config, CI secrets, or a laptop.
-
Pulumi Preview & Diff Review Prompt
Read a Pulumi preview like a code review — distinguishing safe updates from replacements and deletes — so a destructive change is caught in the plan instead of after the apply.
-
Pulumi Monorepo Layout Prompt
Structure a Pulumi monorepo — projects, shared component packages, and affected-stack CI — so many teams share one repo without slow, fragile, everything-deploys-on-every-commit pipelines.
More Pulumi prompts & error guides
Browse every Pulumi prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.