The reference agent's subject, cloud solution architecture, as an agent in the operating model agent's pattern: the Execution engine (from orchestration_engine) and one Workflow in app/solution_architecture, built for the settings and provider bundle by assembly.workflow_for. Copied from gcp_solution_architecture_agent at 8b397cd without its own engine: its role files, Skills, provider bundle, ADRs, vocabulary, scripts and evaluation datasets. The image takes the engine from a named build context and installs Terraform. It is called through the Orchestration engine, and its files are what the operating model agent digests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.2 KiB
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. |
|
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
- Write
assets/versions.tfto your working copy asterraform/versions.tf, unchanged. It pins the provider version these patterns and theterraform_schematool describe. Declare theproject_idandregionvariables it uses interraform/variables.tf. - For each Element in the Target architecture, read the reference for its product with
load_skill_resourceand start from its pattern. Read only the references for products the Target architecture uses. - Change the pattern to meet the Element's Checks. For a setting the pattern does not show, call
terraform_schemawithfindset 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.mdlists what a job lacks. - Grant a role with an
_iam_memberresource. An_iam_bindingor_iam_policyresource 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_protectionfrom a variable on the resources that have it, so a test deployment can be removed.