terraform-gcp

Review and refactor Terraform HCL for Google Cloud Platform resources.

3|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/way-platform/skills --skill terraform-gcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: terraform-gcp
Source: https://github.com/way-platform/skills/tree/main/terraform-gcp
Command: npx skills add https://github.com/way-platform/skills --skill terraform-gcp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and best practices for writing, reviewing, and refactoring Terraform HCL code specifically for Google Cloud Platform (GCP) resources. It aims to ensure consistency, security, and maintainability in your GCP infrastructure as code.

Core Features & Use Cases

  • Standardized HCL: Enforces consistent formatting, naming conventions, and file organization for Terraform configurations.
  • Best Practices: Guides on variable usage, output definition, dependency management, IAM, and stateful resource protection.
  • Module Development: Rules for creating reusable modules, including API activation, version pinning, and exposing labels.
  • Testing & Import: Strategies for testing Terraform code and importing existing GCP resources into Terraform management.
  • Use Case: A team is onboarding new engineers to manage their GCP infrastructure using Terraform. This Skill serves as the definitive guide for all Terraform development, ensuring all code adheres to established standards and security requirements.

Quick Start

Use the terraform-gcp skill to generate a Terraform configuration for a new GCP storage bucket following best practices.

Frequently Asked Questions about terraform-gcp

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

FAQPage Schema
What's the best way to organize Terraform files for GCP infrastructure?

To manage GCP infrastructure with Terraform, establish consistent file organization, naming conventions, and root module structure. This approach ensures maintainability and aligns with HashiCorp and Google Cloud Foundation Toolkit standards.

How do I decide between using for_each versus count when creating GCP resources?

Choosing between for_each versus count for dynamic GCP resource creation depends on your tracking preference. Use for_each to manage resources via string keys, preventing accidental resource recreation when list indices shift during updates.

Should I use additive or authoritative IAM bindings in Terraform for GCP?

IAM best practices for GCP Terraform recommend understanding additive versus authoritative bindings. Additive bindings grant specific roles without overwriting existing permissions, whereas authoritative bindings fully replace all existing policies on the target resource.

How do I import existing GCP resources into Terraform management?

Importing existing GCP resources into Terraform requires using the resource import workflow. This process involves running the import command to map your current Google Cloud Platform infrastructure into your state file, then writing the matching HCL configuration.

Can I test Terraform configurations for Google Cloud Platform before deployment?

You can test Terraform configurations for Google Cloud Platform using .tftest.hcl files. This testing strategy validates your HCL code logic and variable management before applying changes to your actual GCP infrastructure.

What are the rules for creating reusable Terraform modules for GCP?

Creating reusable Terraform modules for GCP requires following specific rules including API activation, version pinning, and exposing labels. This ensures your infrastructure modules are standardized, secure, and maintainable across different environments.