This folder contains the infrastructure code for running TeamPulse Bridge in Google Cloud.
It is written to support production-style environments, not just local demos.
That includes Terraform modules, environment configuration, deployment scripts, and supporting documentation for staging and production operations.
The infrastructure layer answers questions like:
- what cloud resources does the system need
- how are staging and production separated
- how do we provision clusters, networking, storage, and monitoring
- how do we keep infrastructure changes reviewable and repeatable
flowchart LR
A["Terraform"] --> B["Networking"]
A --> C["GKE clusters"]
A --> D["Cloud SQL"]
A --> E["Storage"]
A --> F["Monitoring and alerts"]
B --> C
C --> G["Applications delivered by GitOps"]
terraform/: root Terraform configuration, reusable modules, and environment tfvarsscripts/: helper scripts for backend setup, deploy, destroy, and GitOps bootstrapdocs/: deeper infrastructure-specific operational documentation
From infrastructure/scripts/:
./init-backend.sh staging your-gcp-project-id your-terraform-state-bucketRun this once per environment before the first apply.
make infra-plan-staging
make infra-deploy-stagingFor production:
make infra-plan-prod
make infra-deploy-prodProduction changes should go through review and normal change-control practices.
Infrastructure and deployment are related but not identical:
infrastructure/creates the cloud foundationsdeploy/defines what runs on top of those foundations
Argo CD bootstrap support is provided here through:
scripts/bootstrap-gitops-argocd.sh
Related deployment assets live in:
Validate GitOps manifests from the repository root with:
make gitops-validateterraform/
main.tf
variables.tf
outputs.tf
providers.tf
backend.tf
environments/
staging/
prod/
modules/
database/
gke_cluster/
monitoring/
networking/
security/
storage/
scripts/
init-backend.sh
deploy.sh
destroy.sh
bootstrap-gitops-argocd.sh
docs/
README.md
modules/networking: VPCs, subnets, firewalls, and related network controlsmodules/gke_cluster: GKE clusters and node poolsmodules/database: Cloud SQL and database backup posturemodules/monitoring: dashboards, alerts, and observability plumbingmodules/security: IAM and security-oriented infrastructure concernsmodules/storage: buckets and storage lifecycle configuration
The repository is structured around at least two clear environments:
- staging for safer iteration and validation
- production for higher durability and stronger operational controls
The infrastructure also supports an optional multi-region active-active model for more advanced production setups.
If you enable that model, make sure the application and data layers are designed for it before treating both regions as writable.
For resilience validation, use the regional failover drill documented in docs/regional-failover-drill.md.
From the repository root, operators can run make infra-chaos-drill-failover after exporting the required health-check URLs and any failover or recovery commands for the target environment.
- review
terraform planoutput before every apply - do not manually edit remote Terraform state
- keep production applies behind review and approval
- production IAM exceptions must carry a ticket, expiry date, and are automatically time-bounded in Terraform
- structured security audit logs are routed into a dedicated Cloud Logging bucket with separate retention
- treat
destroy.shas a restricted operation, especially outside non-prod - validate backup and restore assumptions, not just deployment success
From the repository root:
make infra-plan-staging
make infra-plan-prodFrom infrastructure/terraform/:
terraform fmt -recursive
terraform validate
terraform plan -var-file=environments/staging/terraform.tfvars
terraform plan -var-file=environments/prod/terraform.tfvars