Files
gcp_solution_architecture_a…/skills/google-cloud-iac-patterns/SKILL.md
Jonathan Boniface 71da0ed504
Some checks failed
validation / verify (push) Failing after 12s
chore: housekeeping from the runs of 2026-10-09
- An Execution's files are written as each Deliverable is submitted, marked
  in_progress, so a killed process or one waiting for its user leaves them on
  disk. A write removes files an earlier write left that it no longer has.
- A question about delivered work is answered from that Execution's solution
  guide by the reply writer; a question about the service is answered as
  before. Nothing is started for either.
- Lessons: prove writes only for lessons the Skill holds; the Skill records
  the vendored Skill versions the lessons were read against, status names any
  that changed, and a test fails until they are reviewed.
- Four more code patterns: Firestore, BigQuery, Eventarc and GKE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 11:44:38 +01:00

3.2 KiB

name, description, metadata
name description metadata
google-cloud-iac-patterns Terraform patterns for Google Cloud products that validate against one pinned version of the hashicorp/google provider: Cloud Run services and jobs, Pub/Sub, Cloud Storage, IAM, Secret Manager, Cloud KMS, Cloud SQL, networking, load balancing, Cloud Scheduler, Artifact Registry, Monitoring, Firestore, BigQuery, Eventarc, GKE and API enablement. Use when writing Terraform for a Google Cloud product, before writing the resource, to start from a pattern whose arguments are known to be in the right place.
scope provider
deployment guidance hashicorp/google 8.6.0

Google Cloud IaC patterns

Every pattern here passes terraform validate against hashicorp/google 8.6.0. A test runs that on each of them, so an argument you copy from a pattern is in the right block.

How to use them

  1. Write assets/versions.tf to your working copy as terraform/versions.tf, unchanged. It pins the provider version these patterns and the terraform_schema tool describe. Declare the project_id and region variables it uses in terraform/variables.tf.
  2. For each Element in the Target architecture, read the reference for its product with load_skill_resource and start from its pattern. Read only the references for products the Target architecture uses.
  3. Change the pattern to meet the Element's Checks. For a setting the pattern does not show, call terraform_schema with find set to its name before you write it.
Product Reference
Enabling APIs references/project-services.md
Service accounts and IAM grants references/iam.md
Cloud Run service references/cloud-run-service.md
Cloud Run job references/cloud-run-job.md
Pub/Sub references/pubsub.md
Cloud Storage references/cloud-storage.md
Secret Manager references/secret-manager.md
Cloud KMS references/kms.md
Cloud SQL references/cloud-sql.md
VPC networking references/networking.md
External Application Load Balancer, TLS policy, firewall policy, Identity-Aware Proxy references/load-balancer.md
Cloud Scheduler references/cloud-scheduler.md
Artifact Registry references/artifact-registry.md
Cloud Monitoring and Logging references/monitoring.md
Firestore references/firestore.md
BigQuery references/bigquery.md
Eventarc references/eventarc.md
Google Kubernetes Engine references/gke.md

A product with no reference has no pattern yet: write it from terraform_schema and the product documentation.

Rules that hold for every product

  • A Cloud Run service and a Cloud Run job are different resource types with different arguments. A setting of one is not a setting of the other. references/cloud-run-job.md lists what a job lacks.
  • Grant a role with an _iam_member resource. An _iam_binding or _iam_policy resource removes grants made elsewhere.
  • Give a Google-managed service agent its role before the resource that needs it, with depends_on. A key, a dead-letter topic and a push subscription all need one.
  • Set deletion_protection from a variable on the resources that have it, so a test deployment can be removed.