gcp-foundation-fabric
Google Cloud Foundation Fabric (CFF) TerraformモジュールやFASTランディングゾーンの選択、設定、カスタマイズを支援し、GCPの組織構造やネットワーク設計、プロジェクトやVPCの構築をTerraformで行う際に適切な構成を導き出すSkill。
📜 元の英語説明(参考)
Guide selection, configuration, and customization of Google Cloud Foundation Fabric (CFF) Terraform modules and FAST landing zone stages. Use when working with cloud-foundation-fabric, Fabric FAST, GCP landing zones, CFF modules, project factory, VPC factory, or when the user mentions Google Cloud Terraform modules from GoogleCloudPlatform/cloud-foundation-fabric. Also use when designing GCP organization structure, networking stages, or configuring factories_config patterns.
🇯🇵 日本人クリエイター向け解説
Google Cloud Foundation Fabric (CFF) TerraformモジュールやFASTランディングゾーンの選択、設定、カスタマイズを支援し、GCPの組織構造やネットワーク設計、プロジェクトやVPCの構築をTerraformで行う際に適切な構成を導き出すSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gcp-foundation-fabric.zip https://jpskill.com/download/9128.zip && unzip -o gcp-foundation-fabric.zip && rm gcp-foundation-fabric.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9128.zip -OutFile "$d\gcp-foundation-fabric.zip"; Expand-Archive "$d\gcp-foundation-fabric.zip" -DestinationPath $d -Force; ri "$d\gcp-foundation-fabric.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
gcp-foundation-fabric.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
gcp-foundation-fabricフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Google Cloud Foundation Fabric
概要
cloud-foundation-fabric リポジトリ (Google Cloud の公式 Terraform モジュールおよびランディングゾーンツールキット) からのモジュールおよび FAST ステージの選択、構成、カスタマイズについて、エージェントをガイドします。
どのような時に使うか
- いずれかの CFF モジュール (
modules/project、modules/net-vpcなど) を使用する場合 - FAST ランディングゾーンステージをセットアップまたは変更する場合
- ファクトリ (
factories_config、プロジェクトファクトリ、VPC ファクトリ) を構成する場合 - Terraform を使用して GCP 組織階層、ネットワーク、またはセキュリティを設計する場合
- ユーザーが
cloud-foundation-fabricまたは Fabric FAST を参照する場合 - CFF パターンを使用して GCP プロジェクト、VPC、ファイアウォールポリシー、または IAM を作成する場合
使用すべきでない場合:
- (CFF 固有ではない) 一般的な Terraform を使用する場合 — terraform-style-guide を使用してください
- CFF の Terragrunt ラッパーを使用する場合 (基盤となるモジュール構成について質問する場合を除く)
- Cloud Foundation Toolkit (CFT) を使用する場合 — これは別のプロジェクトです
主要な概念
リポジトリ構造
cloud-foundation-fabric/
├── modules/ # 構成可能な Terraform モジュール
├── fast/ # FAST ランディングゾーンステージ
│ └── stages/ # 順次ステージ (0-org-setup、1-vpcsc、2-networking など)
├── blueprints/ # 非推奨 — モジュールを直接使用してください
├── tools/ # Python ユーティリティ (tfdoc、linting、testing)
└── tests/ # pytest + tftest ベースのテスト
モジュールカテゴリ
| カテゴリ | 主要なモジュール |
|---|---|
| 基本 | project、folder、organization、iam-service-account、billing-account |
| ネットワーク | net-vpc、net-vpc-firewall、net-firewall-policy、net-vpn-ha、dns、net-lb-app-ext、net-lb-int、net-cloudnat、net-swp |
| コンピューティング | compute-vm、compute-mig、gke-cluster-standard、gke-cluster-autopilot、gke-nodepool |
| データ | bigquery-dataset、gcs、cloudsql-instance、pubsub、alloydb、spanner-instance、dataproc |
| セキュリティ | kms、secret-manager、vpc-sc、certificate-authority-service、binauthz |
| サーバーレス | cloud-function-v2、cloud-run-v2 |
| 開発 | artifact-registry、apigee、api-gateway |
| ファクトリ | project-factory、net-vpc-factory |
FAST ステージ
FAST ステージは順番に実行され、互いの出力を基に構築されます。
| ステージ | 目的 | 主要なリソース |
|---|---|---|
0-org-setup |
組織、請求、ロギング、CI/CD をブートストラップする | プロジェクト、SA、GCS バケット、IAM |
1-vpcsc |
VPC Service Controls ペリメータ | アクセスポリシー、ペリメータ、レベル |
2-networking |
ハブ/スポークまたは共有 VPC ネットワーク | VPC、サブネット、ファイアウォールポリシー、VPN |
2-security |
KMS、CAS、セキュリティプロジェクト | KMS キーリング、CAS プール |
2-project-factory |
スケールでのマネージドプロジェクト作成 | YAML ファクトリ経由のプロジェクト |
3-* |
ワークロード固有 (GKE、データプラットフォーム) | 可変 |
ワークフロー
1. 適切なモジュールを特定する
ユーザーの GCP リソースのニーズを CFF モジュールに一致させます。
- 上記の モジュールカテゴリテーブル を確認してください
- 各モジュールには、例を含む README があります —
modules/<name>/README.mdで参照してください - モジュールは構成用に設計されています。完全なソリューションのために複数のモジュールを組み合わせます (例:
project+net-vpc+net-vpc-firewall)
2. CFF パターンを使用して構成する
CFF モジュールは一貫したインターフェイスパターンに従います。モジュールブロックを記述するときは、これらを適用します。
IAM パターン — すべてのモジュールは、ロールベースとグループベースの両方の IAM をサポートします。1 つのプリンシパルに複数のロールを付与する場合は、常に group_iam を使用してください (CFF 規約)。
module "project" {
source = "./modules/project"
name = "my-project"
# ロールベース IAM — 1 つのロールが多数のプリンシパルにマッピングされます
iam = {
"roles/viewer" = ["group:viewers@example.com"]
}
# group_iam — 1 つのプリンシパルが多数のロールにマッピングされます (グループに推奨)
group_iam = {
"group:editors@example.com" = ["roles/editor", "roles/iam.serviceAccountUser"]
}
}
命名パターン — prefix 変数を使用し、ランダムなサフィックスは絶対に使用しないでください。
module "project" {
source = "./modules/project"
name = "net-hub-0"
prefix = "myco-gcp-prod" # 結果: myco-gcp-prod-net-hub-0
}
ファクトリパターン — スケールには factories_config を使用します。
module "project-factory" {
source = "./modules/project-factory"
factories_config = {
basepath = "data" # すべてのファクトリデータのルートパス
# パスのデフォルト: projects, folders, budgets, project-templates
}
data_defaults = {
billing_account = "012345-ABCDEF-012345"
parent = "folders/1234567890"
prefix = "myco-dev"
services = ["compute.googleapis.com"]
}
data_merges = {
labels = { managed-by = "project-factory" }
}
}
project-factory は、3 段階の優先順位を使用します: data_defaults (最低) → YAML ファイルデータ → data_overrides (最高)。data_merges はファイルデータと加算的に結合します (便利 f
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Google Cloud Foundation Fabric
Overview
Guide agents through selecting, configuring, and customizing modules and FAST stages from the cloud-foundation-fabric repository — Google Cloud's official Terraform modules and landing zone toolkit.
When to use
- When working with any CFF module (
modules/project,modules/net-vpc, etc.) - When setting up or modifying FAST landing zone stages
- When configuring factories (
factories_config, project factory, VPC factory) - When designing GCP organization hierarchy, networking, or security with Terraform
- When the user references
cloud-foundation-fabricor Fabric FAST - When creating GCP projects, VPCs, firewall policies, or IAM using CFF patterns
Do NOT use when:
- Working with generic Terraform (not CFF-specific) — use terraform-style-guide
- Working with Terragrunt wrappers around CFF (unless asking about underlying module config)
- Working with Cloud Foundation Toolkit (CFT) — that's a different project
Key Concepts
Repository structure
cloud-foundation-fabric/
├── modules/ # Composable Terraform modules
├── fast/ # FAST landing zone stages
│ └── stages/ # Sequential stages (0-org-setup, 1-vpcsc, 2-networking, etc.)
├── blueprints/ # Deprecated — use modules directly
├── tools/ # Python utilities (tfdoc, linting, testing)
└── tests/ # pytest + tftest-based tests
Module categories
| Category | Key Modules |
|---|---|
| Foundational | project, folder, organization, iam-service-account, billing-account |
| Networking | net-vpc, net-vpc-firewall, net-firewall-policy, net-vpn-ha, dns, net-lb-app-ext, net-lb-int, net-cloudnat, net-swp |
| Compute | compute-vm, compute-mig, gke-cluster-standard, gke-cluster-autopilot, gke-nodepool |
| Data | bigquery-dataset, gcs, cloudsql-instance, pubsub, alloydb, spanner-instance, dataproc |
| Security | kms, secret-manager, vpc-sc, certificate-authority-service, binauthz |
| Serverless | cloud-function-v2, cloud-run-v2 |
| Development | artifact-registry, apigee, api-gateway |
| Factories | project-factory, net-vpc-factory |
FAST stages
FAST stages run sequentially and build on each other's outputs:
| Stage | Purpose | Key Resources |
|---|---|---|
0-org-setup |
Bootstrap org, billing, logging, CI/CD | Projects, SAs, GCS buckets, IAM |
1-vpcsc |
VPC Service Controls perimeters | Access policies, perimeters, levels |
2-networking |
Hub/spoke or shared VPC networking | VPCs, subnets, firewall policies, VPNs |
2-security |
KMS, CAS, security projects | KMS keyrings, CAS pools |
2-project-factory |
Managed project creation at scale | Projects via YAML factories |
3-* |
Workload-specific (GKE, data platform) | Varies |
Workflow
1. Identify the right module
Match the user's GCP resource needs to CFF modules:
- Check the module categories table above
- Each module has a README with examples — reference them at
modules/<name>/README.md - Modules are designed for composition: combine multiple modules for
complete solutions (e.g.,
project+net-vpc+net-vpc-firewall)
2. Configure using CFF patterns
CFF modules follow consistent interface patterns. Apply these when writing module blocks:
IAM pattern — every module supports both role-based and group-based IAM.
Always use group_iam when granting multiple roles to one principal (CFF
convention):
module "project" {
source = "./modules/project"
name = "my-project"
# Role-based IAM — one role maps to many principals
iam = {
"roles/viewer" = ["group:viewers@example.com"]
}
# group_iam — one principal maps to many roles (preferred for groups)
group_iam = {
"group:editors@example.com" = ["roles/editor", "roles/iam.serviceAccountUser"]
}
}
Naming pattern — use prefix variable, never random suffixes:
module "project" {
source = "./modules/project"
name = "net-hub-0"
prefix = "myco-gcp-prod" # Results in: myco-gcp-prod-net-hub-0
}
Factory pattern — use factories_config for scale:
module "project-factory" {
source = "./modules/project-factory"
factories_config = {
basepath = "data" # root path for all factory data
# paths default to: projects, folders, budgets, project-templates
}
data_defaults = {
billing_account = "012345-ABCDEF-012345"
parent = "folders/1234567890"
prefix = "myco-dev"
services = ["compute.googleapis.com"]
}
data_merges = {
labels = { managed-by = "project-factory" }
}
}
The project-factory uses a three-tier precedence: data_defaults (lowest) →
YAML file data → data_overrides (highest). data_merges additively combines
with file data (useful for labels, services that should always be present).
Shared VPC pattern — host and service project configuration:
# Host project
module "host-project" {
source = "./modules/project"
name = "net-host-0"
shared_vpc_host_config = {
enabled = true
service_projects = [module.service-project.project_id]
}
}
# Service project (attachment with service agent IAM)
module "service-project" {
source = "./modules/project"
name = "svc-app-0"
shared_vpc_service_config = {
host_project = module.host-project.project_id
# Grant service agents network access (key CFF pattern)
service_agent_iam = {
"roles/compute.networkUser" = [
"cloudservices", "container-engine"
]
}
}
}
Note: CFF uses service_agent_iam (not service_identity_iam) in
shared_vpc_service_config. The keys are short service names like
cloudservices, container-engine, not full email addresses.
VPC subnet pattern — subnets are a list of objects with private access on by default:
module "vpc" {
source = "./modules/net-vpc"
project_id = module.project.project_id
name = "hub-vpc"
subnets = [
{
name = "subnet-eu"
ip_cidr_range = "10.0.0.0/24"
region = "europe-west1"
# enable_private_access defaults to true in CFF
secondary_ip_ranges = {
pods = { ip_cidr_range = "172.16.0.0/20" }
services = { ip_cidr_range = "192.168.0.0/24" }
}
}
]
}
Note: In CFF, secondary_ip_ranges is a map of objects with ip_cidr_range
keys (not bare strings). Private Google Access is enabled by default via
enable_private_access = true.
Cloud NAT pattern — always pass router_network for the VPC self-link:
module "nat" {
source = "./modules/net-cloudnat"
project_id = var.project_id
region = "europe-west1"
name = "hub-nat"
router_network = module.vpc.self_link
}
Firewall policy rules — use layer4_configs for protocol/port matching:
module "fw-policy" {
source = "./modules/net-firewall-policy"
name = "iap-ssh"
parent_id = var.organization_id
rules = {
allow-iap-ssh = {
direction = "INGRESS"
action = "allow"
priority = 1000
match = {
src_ip_ranges = ["35.235.240.0/20"]
layer4_configs = [{ protocol = "tcp", ports = ["22"] }]
}
}
}
}
3. Work with FAST stages
When modifying or extending FAST stages:
- Understand stage contracts — each stage consumes outputs from previous
stages via
variableblocks with# tfdoc:variable:source <stage>comments - Use output files — FAST generates provider and tfvars files in GCS for downstream stages; maintain this system when adding outputs
- Leverage factories — FAST stages use
factories_configto drive resource creation from YAML; prefer adding YAML files over modifying HCL - Respect the stage DAG — stages 0 → 1 → 2 → 3; don't create circular dependencies
4. Customize modules
When extending or modifying CFF modules:
- Fork the repo — CFF is designed to be cloned and forked for production
- Follow the Zen of Fabric — design by logical entity, use stable interfaces, prefer flat code, don't be too opinionated
- Update documentation — run
tools/tfdoc.py modules/<name>after changing variables or outputs - Write tests — add README examples with
# tftest modules=N resources=Mcomments; optionally add inventory YAML files - Use descriptive file names — not
main.tf/variables.tf/outputs.tfbutiam.tf,vpc.tf,factory.tf
5. Test your code
# Format
terraform fmt -recursive
# Update docs
./tools/tfdoc.py modules/<module-name>
# Run tests
pytest tests/examples # all examples
pytest -k 'modules and <module>:' tests/examples # specific module
pytest tests # full suite
Checklist
- [ ] Correct CFF module identified for the GCP resource type
- [ ] Module block uses CFF interface patterns (IAM, naming, factories)
- [ ] Variables use object types with defaults (not flat scalar variables)
- [ ]
prefixused instead of random suffixes for naming - [ ] Output
depends_onincludes all internal resources for safe composition - [ ] FAST stage contracts respected (variables sourced from correct upstream stage)
- [ ] Factory YAML files follow the module's expected schema
- [ ]
tfdocregenerated after variable/output changes - [ ] Tests pass (
pytest -k 'modules and <name>:' tests/examples)
Common Mistakes
| Mistake | Fix |
|---|---|
| Using random suffixes in resource names | Use prefix variable: prefix = "myco-gcp-dev" |
| Flat scalar variables for complex config | Use object variables with optional attributes and defaults |
| Managing IAM in a separate module | Put IAM in the same module as the resource (CFF design principle) |
| Manually editing README variable tables | Run ./tools/tfdoc.py modules/<name> to regenerate |
| Referencing modules by registry | Clone the repo and reference locally or via git tag: source = "github.com/...//modules/project?ref=v54.0.0" |
| Creating sub-modules inside a module | Keep modules flat — avoid nesting to reduce complexity |
Using main.tf for everything |
Use descriptive filenames: iam.tf, vpc.tf, factory.tf |
Ignoring depends_on in outputs |
Always add depends_on = [module.X] to outputs so consumers wait for full configuration |
| Breaking FAST stage contracts | Check # tfdoc:variable:source comments for required upstream outputs |
Using terraform-google-modules/* patterns |
CFF has different conventions — don't mix patterns from CFT/terraform-google-modules |
Quick Reference
| Operation | How |
|---|---|
| Find a module | Browse modules/ directory or check the module categories table |
| Reference a module | source = "./modules/<name>" (local) or "github.com/GoogleCloudPlatform/cloud-foundation-fabric//modules/<name>?ref=v54.0.0" (remote) |
| Add IAM to any resource | Use iam = { "roles/X" = ["member:Y"] } variable (standard across all modules) |
| Create projects at scale | Use project-factory module with factories_config.projects pointing to YAML dir |
| Create VPCs at scale | Use net-vpc-factory module with factories_config.vpcs pointing to YAML dir |
| Set org policies | Use org_policies factory key in project, folder, or organization modules |
| Configure firewall rules | Use net-firewall-policy module with factories_config for YAML-driven rules |
| Set up Shared VPC | Use shared_vpc_host_config on host project, shared_vpc_service_config on service projects |
| Run FAST stage | cd fast/stages/<stage> && terraform init && terraform apply |
| Bootstrap a new org | Start with fast/stages/0-org-setup |
| Update module docs | ./tools/tfdoc.py modules/<module-name> |
| Run module tests | pytest -k 'modules and <name>:' tests/examples |
| Generate test inventory | pytest -s 'tests/examples/test_plan.py::test_example[modules/<name>:...]' |
| Check all linting | ./tools/lint.sh |
Key Principles
-
Design by logical entity — modules encapsulate all resources for a single functional unit (project + IAM + services + org policies), not by product. This improves readability and ensures consumers get fully-configured units.
-
Stable interfaces — the same variable pattern (
iam,factories_config,prefix,labels) is reused across all modules. Learn it once, apply everywhere. -
Factories for scale — YAML-driven factories (
factories_config) are the preferred pattern for managing many similar resources. Add YAML files instead of duplicating HCL blocks. -
Fork and own — CFF is designed to be cloned and customized. Reference via git tags for stability, but expect to modify code for production needs.
-
Flat and explicit — avoid sub-modules, magic, and deep indirection. Code should be readable as documentation. Prefer 79-char line lengths and alphabetical ordering of variables/outputs.