Cloud Foundation Fabric

repository·master·Indexed 24 days ago

https://github.com/googlecloudplatform/cloud-foundation-fabric

Production-ready Terraform blueprints and modules for Google Cloud, featuring a landing zone toolkit (Fabric FAST) and a library of reusable infrastructure modules. Includes specialized networking add-ons for Cloud Next Generation Firewall (NGFW) Enterprise and Secure Web Proxy (SWP), providing guidance on provider linking, variable configuration, and deployment via Terraform.

Tokens
368.9K
Snippets
711
Records
1.3K
Agent score
84%

What's inside Cloud Foundation Fabric

  1. Overview of the External Application Load Balancer Module

    master

    The net-lb-app-ext module is used to manage Google Cloud Global HTTP/HTTPS Classic Load Balancers (GLBs). It is designed to expose the full configuration of the underlying resources while providing sensible defaults for common usage patterns. The module can optionally manage prerequisite resources such as health checks and instance groups.

    Important Migration Note: Because the underlying resources are complex, configuration changes that require resource recreation should be applied in stages to minimize impact. A recommended workflow is:

    1. Disable the configuration in the urlmap that references the resources needing recreation.
    2. Disable the configuration in the backend_service.
    3. Proceed with the resource recreation.
  2. Overview of the External Regional Application Load Balancer Module

    master

    The net-lb-app-ext-regional module is used to manage External Regional HTTP/HTTPS Application Load Balancers on Google Cloud. It is designed to expose the full configuration of the underlying resources while providing sensible defaults for common usage patterns. It can optionally manage prerequisite resources such as health checks and instance groups.

    Key Constraints and Considerations

    • Feature Parity: This module's variable space closely mirrors the net-lb-app-ext module, but it does not support certain features available in the global version, specifically GCS backends and Internet NEGs. For a full list of differences, refer to the Google Cloud load balancing feature comparison matrix.
    • Resource Recreation: Because the underlying resources are complex, changes that require resource recreation should be applied in stages to avoid downtime or errors. A recommended sequence is:
      1. Disable the configuration in the urlmap that references the resources needing recreation.
      2. Disable the configuration in the backend service.
      3. Proceed with the resource recreation.
  3. Overview of Cloud Foundation Fabric (CFF) Tools

    master
    The CFF Tools directory contains utility scripts and tools designed to automate various aspects of the repository lifecycle, including documentation generation, testing, repository maintenance, and linting/compliance. These tools help maintain high standards for Terraform modules, JSON schemas, and overall repository health.
  4. Overview of FAST stages (0-3)

    master

    The FAST stages are categorized by their role in the organization lifecycle:

    Stage 0: Organization

    • Organization Setup: Bootstraps the organization and resource management. It uses factories to allow flexible configuration of all related resources.

    Stage 1: VPC Service Controls

    • VPC Service Controls: Optionally configures VPC Service Controls (VPC SC) protection for the organization.

    Stage 2: Shared Resources

    • Security: Managed by security teams. Creates projects for centralized KMS keys and Certificate Authority Service (CAS) instances.
      • Exports: KMS key ids, CA ids.
    • Networking: Managed by networking teams. Provides various designs via YAML datasets (e.g., hub-and-spoke with VPC Peerings, VPNs, NVAs, and NCC).
      • Exports: host project ids and numbers, vpc self links.
    • Project Factory: A YAML-based factory for creating application or team-level projects. Handles Shared VPC settings, CMEK encryption via centralized keys, and service account creation.

    Stage 3: Applications and Operations

    • SecOps Setup: Configures Google SecOps at both infrastructure and application levels, including Data RBAC, IAM, Detection Rules, and Google Workspace integrations.
  5. Overview of the Cloud SQL instance module

    master

    The cloudsql-instance module manages the creation of Cloud SQL instances, including support for cross-regional read replicas. It can also provision an initial set of databases and users.

    Key Behaviors:

    • Inheritance: Replicas inherit most settings from the primary instance (e.g., disks, labels, flags). However, the tier can be overridden per-replica using replicas.<name>.tier.
    • Security Warning: If you use the users parameter to define users, their passwords will be stored in plain text within your Terraform state file.
  6. Overview of Fabric FAST

    master

    Fabric FAST is a design and reference implementation for setting up a production-ready Google Cloud Platform (GCP) organization. It provides a blueprint for enterprise-grade GCP structures, including typical elements required by large organizations, implemented using Terraform.

    While the reference implementation uses Terraform, the FAST design is conceptual and refers only to GCP constructs, meaning it can theoretically be implemented with other tools like Pulumi or direct API calls. It is designed to be scalable for organizations of all sizes, from startups to large enterprises, through various customization points.

  7. Overview of the Internal Application Load Balancer Module

    master

    The net-lb-app-int module is used to manage Google Cloud Internal HTTP/HTTPS Load Balancers (L7 ILBs). It is designed to expose the full configuration of the underlying resources while providing sensible defaults for common usage patterns. The module can optionally manage prerequisite resources such as health checks and instance groups.

    Important Migration Note: Due to the complexity of the underlying resources, if you need to make configuration changes that require resource recreation, it is recommended to apply these changes in stages. A safe sequence is:

    1. Disable the configuration in the urlmap that references the resources needing recreation.
    2. Disable the configuration in the backend_service.
    3. Proceed with the resource recreation.
  8. Overview of the SecOps Stage

    master

    The SecOps Stage automates the configuration of a Google SecOps instance at both the infrastructure and application levels. It leverages native Terraform resources and the restful_resource to interact with SecOps APIs.

    Key capabilities include:

    • Enabling APIs and services.
    • Configuring Data RBAC with labels and scopes.
    • Setting up IAM for the SecOps instance using Cloud Identity groups or Workload Identity Federation (WIF).
    • Managing Detection Rules and reference lists via Terraform (using the secops-rules module).
    • Setting up API Keys for Webhook feeds.
    • Integrating with Google Workspace for alert and log ingestion via SecOps Feeds.
  9. Overview of the FAST 0-org-setup Prerequisites Workflow

    master

    The FAST 0-org-setup prerequisites guide is a structured, four-phase workflow designed to prepare a Google Cloud environment for the FAST (Fabric Automated Setup Toolkit) landing zone bootstrap. The workflow ensures that all necessary authentication, administrative identities, IAM roles, and configuration files are in place before running Terraform.

    Workflow Phases:

    1. Phase 1: Environment & Authentication: Identifies if the target is Standard GCP or Google Cloud Dedicated (GCD) and verifies authentication.
    2. Phase 2: Admin Principal & Baseline Info: Defines the administrative identity (Group vs. Single User) and gathers Organization and Billing IDs.
    3. Phase 3: Bootstrap Project & IAM: Assigns organization-level IAM roles and sets up a temporary project for API quota tracking.
    4. Phase 4: Configuration & Wrap-up: Generates the FAST dataset configuration (including defaults.yaml), checks organization policies, and prepares for the final Terraform apply.
  10. Overview of the Internal Passthrough Network Load Balancer Module

    master

    The net-lb-int module manages a Google Compute Engine (GCE) Internal Passthrough Network Load Balancer. It integrates the following resources:

    • Forwarding rules
    • Regional backends
    • Optional health checks

    This module is designed to work alongside the compute-vm module, which is typically used to manage instance templates and instance groups that serve as the load balancer's backends.

  11. Overview of the Project Factory stage

    master

    The Project Factory stage enables simplified management of Google Cloud folder hierarchies and projects using YAML-based configuration files. It acts as a thin wrapper around the project-factory module, which exposes the interfaces of the project and folder modules.

    Key features include:

    • Context Interpolation: It can consume resources from previous stages (Bootstrap, Networking, Security, VPC SC) using var.context to automatically reference folder IDs, project IDs, IAM principals, tags, KMS keys, and VPC SC perimeters.
    • Project Defaults: It allows setting defaults for prefix, billing account, and storage location.
    • Multi-pattern Support: Multiple project factories can coexist in a single landing zone, each pointing to different configuration files to implement different organizational patterns (e.g., business units, applications, or teams).
  12. Overview of Cloud Foundation Fabric

    master

    Cloud Foundation Fabric provides end-to-end blueprints and a suite of Terraform modules for Google Cloud. It is designed to support two primary use cases:

    1. Fabric FAST (fast/): An organization-wide landing zone toolkit used to bootstrap production-ready GCP organizations. It provides both a design for enterprise-scale GCP organizations and a reference implementation using Terraform.
    2. Terraform Modules: A comprehensive collection of lean, reusable modules for rapid infrastructure composition. These modules are designed to be simple, readable, and easy to fork for environments where third-party code is restricted.

    Recommended Usage Pattern: The repository is intended to be cloned as a single unit. For production usage, it is recommended to fork the repository into separate owned repositories to seed your environment or use it as-is for prototyping while periodically updating it.