Macumba Backend Deployment Guide¶
This document outlines how to deploy the Macumba FastAPI backend to different environments and cloud providers.
Deployment Options¶
The application can be deployed to:
- Cloud Providers:
- AWS ECS Fargate
-
Google Cloud Run
-
Environments:
dev(Development)stg(Staging)prod(Production)
GitHub Actions Deployment¶
Option 1: Unified Deployment Workflow (Recommended)¶
The simplest way to deploy is using our unified deployment workflow that lets you select both the environment and cloud provider:
- Navigate to the GitHub repository's "Actions" tab
- Select "Deploy Macumba Backend" from the workflows list
- Click "Run workflow"
- Select:
- Environment: dev, stg, or prod
- Cloud Provider: aws or gcp
- Run database setup scripts?: Check this box if you need to run
setup_db.pyandpopulate_airports.py(e.g., for a new environment or major schema change). Defaults to false (unchecked). This applies to both AWS and GCP deployments. - Click "Run workflow" to start the deployment

Option 2: Provider-Specific Workflows¶
You can also use the provider-specific workflows directly:
AWS Deployment¶
- Navigate to the GitHub repository's "Actions" tab
- Select "Deploy FastAPI Backend to AWS" from the workflows list
- Click "Run workflow"
- Select the environment (dev, stg, or prod)
- Run database setup scripts?: Check this box if you need to run
setup_db.pyandpopulate_airports.py. Defaults to false. - Click "Run workflow"
GCP Deployment¶
- Navigate to the GitHub repository's "Actions" tab
- Select "Deploy FastAPI Backend" (this is the
deploy-fastapi.ymlfor Cloud Run) from the workflows list - Click "Run workflow"
- Select the environment (dev, stg, or prod)
- Run database setup scripts?: Check this box if you need to run
setup_db.pyandpopulate_airports.py. Defaults to false. - Click "Run workflow"
Environment Configuration¶
Each environment has its own configuration setup:
AWS Environments¶
- Development:
- Cluster:
macumba-dev-cluster - Service:
macumba-dev-fastapi -
Resources: 256 CPU units, 512MB memory
-
Staging:
- Cluster:
macumba-stg-cluster - Service:
macumba-stg-fastapi -
Resources: 256 CPU units, 512MB memory
-
Production:
- Cluster:
macumba-prod-cluster - Service:
macumba-prod-fastapi - Resources: 512 CPU units, 1024MB memory
GCP Environments¶
- Development:
- Service:
macumba-travel-backend-dev - Region:
australia-southeast1 -
Resources: 1 CPU, 2GB memory
-
Staging:
- Service:
macumba-travel-backend-stg - Region:
australia-southeast1 -
Resources: 1 CPU, 2GB memory
-
Production:
- Service:
macumba-travel-backend-prod - Region:
australia-southeast1 - Resources: 1 CPU, 2GB memory
Database Setup Scripts Execution¶
When the "Run database setup scripts?" option is checked for either AWS or GCP deployments:
- AWS: One-off ECS tasks are launched to execute
scripts/setup_db.pyandscripts/populate_airports.pyagainst the RDS database. - GCP: The GitHub Actions workflow runner will:
- Download and start the Cloud SQL Proxy to connect to the specified Cloud SQL instance.
- Execute
scripts/setup_db.pyandscripts/populate_airports.pyusing this proxied connection. - Stop the Cloud SQL Proxy.
This ensures that database initialization and data population are handled consistently and can be optionally triggered for both cloud providers.
Troubleshooting¶
Common AWS Deployment Issues¶
- Permission Errors:
- Verify the GitHub Actions role has the necessary permissions in the AWS account
-
Check IAM configuration in
infra/terraform_aws/github_actions_oidc.tf -
Database Initialization Fails:
- Check the CloudWatch logs for the ECS task
- Ensure database connectivity from the ECS task
Common GCP Deployment Issues¶
- Permission Errors:
- Verify the GitHub Actions service account has necessary permissions
-
Check IAM configuration in Google Cloud Console
-
Secret Access Issues:
- Ensure all required secrets exist in Google Secret Manager
- Verify the service account has access to read these secrets
Manual Deployment¶
AWS Manual Deployment¶
For manual AWS deployment, refer to detailed instructions in AWS_DEPLOYMENT.md.
GCP Manual Deployment¶
For manual GCP deployment, refer to detailed instructions in GCP_DEPLOYMENT.md.