-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Open
Copy link
Labels
enhancementNew feature or requestNew feature or requesttriageIssues / Features awaiting triageIssues / Features awaiting triage
Milestone
Description
π§ Epic
Title: Terraform Module β "mcp-gateway-gcp"
Goal
Release an official Terraform module (terraform-google-mcpgateway
) that deploys a production-ready MCP Gateway on Google Cloud Platform with a single terraform apply
.
The module must support both GKE (Google Kubernetes Engine) and Cloud Run targets, ship opinionated defaults, and remain purely optional for users who prefer other deployment approaches.
Registry target: registry.terraform.io/ibm-mcp-gateways/mcpgateway/google
π§ Type of Feature
- Infrastructure-as-Code
- Operator tooling
π Module Features & Inputs
Variable | Type / Default | Description |
---|---|---|
platform |
"gke" | "cloudrun" | "none" |
GKE Autopilot cluster or fully-managed Cloud Run service. |
gateway_version |
string (default "latest" ) |
Docker tag to run. |
replicas |
number (default 2 ) |
Deployment replica count (GKE Deployment or Cloud Run revision min-instances). |
db_engine |
"cloudsql-postgres" | "spanner" | "sqlite" |
Choose Cloud SQL (PostgreSQL), Cloud Spanner, or in-pod SQLite. |
enable_redis |
bool (default true ) |
Provision Memorystore (Redis) for rate-limiting & sessions. |
custom_domain |
string |
Managed Certificate + Cloud Load Balancer for HTTPS. |
policy_bundle_gcs_uri |
string |
(optional) gs:// URI for Rego bundle (Policy-as-Code engine). |
observability |
object |
Enable Cloud Logging, Cloud Monitoring dashboards, and Log-Based Alerts. |
labels |
map(string) |
GCP resource labels. |
Outputs: HTTPS Load Balancer URL, Cloud Run service URL (when used), Cloud SQL connection name, Service Account emails.
πββοΈ User Stories & Acceptance Criteria
Story 1 β Minimal GKE Autopilot Deploy
Scenario: Deploy Gateway on GKE Autopilot
Given gcloud auth is set and project "mcp-demo" selected
When I write:
module "gateway" {
source = "ibm-mcp-gateways/mcpgateway/google"
platform = "gke"
custom_domain = "api.demo.example.com"
labels = { env = "demo", team = "platform" }
}
And run "terraform apply"
Then https://api.demo.example.com/health returns 200
And GET /version shows gateway_version
Story 2 β Cloud Run with Cloud SQL & Memorystore
Scenario: Cloud Run + Cloud SQL
Given variables platform="cloudrun" db_engine="cloudsql-postgres"
When apply completes
Then a Cloud SQL instance is RUNNABLE
And Cloud Run logs show "Connected to Cloud SQL β"
Story 3 β Policy Bundle from Cloud Storage
Scenario: Attach Rego bundle
Given gs://policy-bucket/bundle.tar.gz exists
And policy_bundle_gcs_uri="gs://policy-bucket/bundle.tar.gz"
When service starts
Then gateway logs "Loaded policy bundle (v1)" within 60 s
Story 4 β Destroy Preserves Existing VPC (flag)
Scenario: Keep shared VPC
Given create_vpc=false
When apply then destroy
Then shared VPC "prod-shared-vpc" still exists
π Reference Architecture (PlantUML)
@startuml
skinparam componentStyle rectangle
package "Google Cloud" {
[HTTPS Load Balancer] --> [GKE Deployment] : 443
[HTTPS Load Balancer] --> [Cloud Run Service] : 443
[GKE Deployment] --> [Cloud SQL]
[Cloud Run Service] --> [Cloud SQL]
[GKE Deployment] --> [Memorystore Redis]
[Cloud Run Service] --> [Memorystore Redis]
}
note left of "HTTPS Load Balancer"
Optionally fronted
by Cloud Armor WAF
end note
@enduml
π Repository Layout
terraform-google-mcpgateway/
βββ main.tf
βββ variables.tf
βββ outputs.tf
βββ versions.tf
βββ modules/
β βββ gke/
β βββ cloudrun/
β βββ cloudsql/
β βββ redis/
βββ examples/
β βββ gke_minimal/
β βββ cloudrun_full/
βββ docs/
βββ README.md
βββ advanced.md
βββ architecture.puml
π Global Acceptance Checklist
-
terraform validate
, tflint, checkov pass with no high/critical issues. - Example configs deploy successfully in us-central1;
/health
returns 200. - Module published on Terraform Registry with inputs/outputs tables & diagrams.
- CI workflow runs
terraform init -backend=false && terraform validate && terraform fmt -check
. - README includes Quick-Start, advanced options, and monthly cost estimate.
- Supports Terraform β₯ 1.6 and Google provider β₯ 5.0.
- Rego bundle fetched from GCS when
policy_bundle_gcs_uri
is set. - Cloud Monitoring dashboard JSON & alert policy outputs provided when observability enabled.
π Roll-Out Plan
- Scaffold repo
terraform-google-mcpgateway
. - Implement Cloud Run path; add Cloud SQL & Memorystore sub-modules.
- Port to GKE Autopilot with node auto-provisioning.
- Provide fully-worked examples and CI validation.
- Add Monitoring dashboard (JSON) and Alerting Policy sample.
- Publish to Terraform Registry; tag v0.1.0.
- Record demo GIF and cross-link from main MCP Gateway README.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttriageIssues / Features awaiting triageIssues / Features awaiting triage