terraform

Guide Terraform module development for Google Cloud infrastructure.

3|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/benjaminwestern/google-engineer-skills --skill terraform-benjaminwestern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform
Source: https://github.com/benjaminwestern/google-engineer-skills/tree/main/skills/terraform
Command: npx skills add https://github.com/benjaminwestern/google-engineer-skills --skill terraform-benjaminwestern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and best practices for writing, testing, and deploying Terraform code, ensuring robust, secure, and maintainable infrastructure as code.

Core Features & Use Cases

  • Best Practices: Enforces seven core mantras for Terraform development (versions.tf, backend.tf, locals.tf, etc.).
  • Code Structure: Guides on vertical file organization, naming conventions, and module boundaries.
  • Testing & CI/CD: Details on testing frameworks (native, Terratest) and CI/CD pipeline patterns (OIDC, apply strategies).
  • Security: Emphasizes OIDC for authentication, secure secrets management, and network security.
  • Use Case: A team is building a new microservice on GCP and needs to define its network, compute, and database resources using Terraform. This Skill provides the patterns and checklists to ensure the code is secure, testable, and follows Google Cloud best practices.

Quick Start

Use the terraform skill to generate a new Terraform module for a GCE instance, following best practices for variable definitions and outputs.

Frequently Asked Questions about terraform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What's the best way to structure Terraform modules for Google Cloud infrastructure?

Structure Terraform modules for Google Cloud using vertical file organization, separating versions.tf, backend.tf, and locals.tf, and adhering to strict naming conventions to ensure maintainable infrastructure as code.

How do I set up a CI/CD pipeline for Terraform deployments?

Set up Terraform CI/CD pipelines by implementing OIDC for authentication and defining apply strategies. This enforces secure, automated infrastructure deployments without relying on long-lived credentials.

How does OIDC authentication secure Terraform state management?

OIDC authentication secures Terraform state management by replacing static secrets with short-lived tokens. This approach protects backend configurations and enforces secure secrets management during deployments.

Can I use Terratest for testing Google Cloud infrastructure as code?

Yes, you can use Terratest alongside native testing frameworks to validate Google Cloud infrastructure as code. These frameworks verify module logic and resource configurations before deployment.

When should I enforce specific file boundaries in Terraform code?

Enforce file boundaries like versions.tf, backend.tf, and locals.tf immediately when developing new Terraform modules. This vertical file organization prevents configuration drift and ensures secure state management.