Skip to main content

Google Cloud Foundation Fabric: Serverless HCL Refactoring & Validation (PR #3881)

153 words·1 min· loading · loading · ·
Vijay Kumar Singh
Open Source Terraform GCP Cloud-Functions iac HCL Open-Source
Vijay Kumar Singh
Author
Vijay Kumar Singh
Microsoft Certified: DP-900, AI-900, AI-102 & Google Cloud: Associate Cloud Engineer. Open to DevOps, SRE, Cloud, DevSecOps, AI, GenAI, MLOps, and AIOps roles
Table of Contents

Project Overview
#

Google Cloud Foundation Fabric (CFF) is an open-source, enterprise-grade suite of Terraform modules developed and maintained by Google. It serves as the foundation for enterprise landing zones and cloud infrastructure on Google Cloud Platform.

I contributed to the cloud-function-v2 module by adding explicit support for Cloud Functions v2 Runtime Update Policies (Automatic vs. On-Deploy updates).

Key Technical Contributions
#

  • HCL Schema Modernization: Refactored function_config variable definitions to use modern Terraform standards (nullable = false, default = {}, and optional() attributes).
  • Shift-Left Validation: Implemented native HCL validation blocks to enforce mutual exclusivity between automatic and on-deploy policies during terraform plan, preventing downstream GCP API apply failures.
  • Dynamic Blocks: Utilized dynamic blocks inside google_cloudfunctions2_function resources to render configuration blocks only when explicitly requested.
  • CI/CD Testing & Docs: Wrote YAML example-based tests (automatic-update-policy.yaml) and used Google’s Python documentation generator to update the module README.md.

Links & Pull Request #

Reply by Email