https://github.com/mel-cdn/apollo-graphos-router-google-cloud-run
In this guide, we’ll deploy a router endpoint to Google Cloud Run with Terraform, following an approach inspired by Apollo’s official deployment guide.
https://github.com/mel-cdn/apollo-graphos-router-google-cloud-run
apollo apollo-graphos apollo-graphql apollo-router azure-devops docker google-cloud-run graphql terraform
Last synced: about 1 month ago
JSON representation
In this guide, we’ll deploy a router endpoint to Google Cloud Run with Terraform, following an approach inspired by Apollo’s official deployment guide.
- Host: GitHub
- URL: https://github.com/mel-cdn/apollo-graphos-router-google-cloud-run
- Owner: mel-cdn
- Created: 2025-10-04T07:50:42.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-10-05T11:59:37.000Z (8 months ago)
- Last Synced: 2025-10-28T17:35:56.984Z (8 months ago)
- Topics: apollo, apollo-graphos, apollo-graphql, apollo-router, azure-devops, docker, google-cloud-run, graphql, terraform
- Language: HCL
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apollo GraphOS Router as Cloud Run Service
## 📖 Overview
In this guide, we’ll deploy a router endpoint to Google Cloud Run with Terraform, following an approach inspired by
Apollo’s official
deployment [guide](https://www.apollographql.com/docs/graphos/routing/self-hosted/containerization/gcp).
---
## ✨ Highlights
-  Apollo GraphQL
-  Containerization with Docker
-  Google Cloud Platform (GCP)
-  Infrastructure as Code via Terraform
-  Automated CI/CD using Azure DevOps Pipelines (Terraform validation + deployment)
---
## 🚀 Getting Started
### Prerequisites
Before proceeding, ensure the following are installed and configured:
- **Google Cloud Project**
- Create a free [Google Cloud Account](https://console.cloud.google.com/)
- Install the [gcloud CLI](https://cloud.google.com/sdk/docs/install)
- **Terraform**
- Install the [Terraform CLI](https://developer.hashicorp.com/terraform/install)
- **Apollo GraphQL Account**
- Create a free [Apollo GraphQL Account](https://www.apollographql.com/)
- Create a `Graph` (Supergraph)
- Store these values to your GCP Secret Manager
- `apollo-api-key` -> APOLLO_KEY
- e.g. service::
- `apollograph-id` -> APOLLO_GRAPH_REF (e.g. `@current`)
- This [repository](https://github.com/mel-cdn/python-strawberry-graphql-fastapi-apollo) provides the infrastructure and pipeline setup needed to deploy and publish a **Subgraph** to an **Apollo Supergraph**
### Authenticate Google Cloud Credentials
```bash
# Authenticate your GCP account
gcloud init
# Set your default project
gcloud config set project
# Configure application default credentials (for SDKs and integrations)
gcloud auth application-default login
```
### Installation
```bash
# Clone repository
git clone https://github.com/mel-cdn/apollo-graphos-router-google-cloud-run.git
cd apollo-graphos-router-google-cloud-run
```
### Deployment via Terraform
```bash
# Move to Terraform path
cd ./terraform
# Initialize Terraform with your remote backend
terraform init --backend-config="bucket="
# Format Terraform configuration files
terraform fmt
# Validate configuration
terraform validate
# Generate execution plan
terraform plan \
-var="project_prefix=$(GCP_PREFIX)" \
-var="environment=$(ENVIRONMENT)" \
-var="region=$(GCP_REGION)" \
-var="root_domain_name=$(ROOT_DOMAIN_NAME)" \
-out=tfplan
# Apply changes
terraform apply tfplan
```
### Publish Subgraph to Supergraph
```bash
APOLLO_KEY= rover subgraph publish \
--schema="./tmp/schema.graphql" \
--name="subgraph-name" \
--routing-url="https:///graphql"
```