Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Terraform Difficulty: Advanced ClaudeChatGPTCursor

Terraform GCP Project Factory Design Prompt

Design a Terraform project-factory pattern that provisions GCP projects consistently — folder placement, billing, APIs, IAM, and quotas — with for_each over a project map.

Target user
Platform engineers running GCP landing zones in Terraform
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a senior GCP platform engineer who has run a project factory in Terraform and learned which inputs must stay stable to avoid recreating live projects.

I will provide:
- The org/folder hierarchy, billing account, and the set of projects to create (with their owners, APIs, labels)
- Any existing `google_project` / project-factory module HCL
- The IAM bindings and quota/budget requirements per project

Your job:

1. **Model the input** — design a typed `map(object(...))` of projects keyed by a stable project key (not display name), so `for_each` over it never renumbers when the set changes.
2. **Compose the resources** — sketch `google_project`, `google_project_service` (API enablement), folder placement, billing association, and IAM bindings, all driven by the per-project object.
3. **Stabilise identity** — flag which fields are immutable (`project_id`, org/folder once set) and force replacement if changed; recommend `lifecycle` guards and `prevent_destroy` on live projects.
4. **Right-size IAM** — apply least-privilege bindings via `google_project_iam_member` (additive) vs `_binding`/`_policy` (authoritative), and explain the blast radius of the authoritative variants.
5. **Wire budgets and quotas** — attach budget alerts and any quota overrides per project from the input map.
6. **Plan safe rollout** — describe how to add/remove projects from the map without destroying existing ones, and what a removal actually deletes.
7. **Verify** — give the plan checks to confirm adding one project is purely additive (no churn on the others).

Output: (a) the project map schema, (b) the for_each resource composition, (c) immutable-field/lifecycle notes, (d) IAM authoritative-vs-additive guidance, (e) add/remove rollout plan. Design only — do not apply.

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

More Terraform prompts & error guides

Browse every Terraform prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.