|
| 1 | +--- |
| 2 | +title: "AWS CDK Deployment" |
| 3 | +description: "Serverless deployment of eoAPI on AWS using CDK" |
| 4 | +external_links: |
| 5 | + - name: "eoapi-cdk Repository" |
| 6 | + url: "https://github.com/developmentseed/eoapi-cdk" |
| 7 | + - name: "eoapi-template Repository" |
| 8 | + url: "https://github.com/developmentseed/eoapi-template" |
| 9 | +--- |
| 10 | + |
| 11 | +# AWS CDK Deployment |
| 12 | + |
| 13 | +[← Back to Deployment](../deployment.md) |
| 14 | + |
| 15 | +Serverless deployment of eoAPI on AWS using Lambda, RDS, and API Gateway. |
| 16 | + |
| 17 | +## Architecture |
| 18 | + |
| 19 | +eoAPI on AWS CDK provides: |
| 20 | +- AWS Lambda functions for API services |
| 21 | +- Amazon RDS PostgreSQL database |
| 22 | +- API Gateway for routing and management |
| 23 | +- CloudFormation for infrastructure as code |
| 24 | +- Automatic scaling based on request volume |
| 25 | +- Pay-per-request pricing model |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +- AWS account with appropriate permissions |
| 30 | +- AWS CLI configured |
| 31 | +- Node.js 14+ |
| 32 | +- Python 3.8+ |
| 33 | +- AWS CDK CLI |
| 34 | + |
| 35 | +## Quick Start |
| 36 | + |
| 37 | +1. **Clone and Setup** |
| 38 | +```bash |
| 39 | +git clone https://github.com/developmentseed/eoapi-template.git |
| 40 | +cd eoapi-template |
| 41 | + |
| 42 | +python -m venv .venv |
| 43 | +source .venv/bin/activate |
| 44 | +python -m pip install -r requirements.txt |
| 45 | +npm install |
| 46 | +``` |
| 47 | + |
| 48 | +2. **Configure** |
| 49 | +```bash |
| 50 | +# Copy and edit configuration |
| 51 | +cp config.yaml.example config.yaml |
| 52 | +# Edit config.yaml with your settings |
| 53 | +``` |
| 54 | + |
| 55 | +3. **Bootstrap CDK** (one-time per AWS account) |
| 56 | +```bash |
| 57 | +PROJECT_ID=eoAPI STAGE=staging npx cdk bootstrap |
| 58 | +``` |
| 59 | + |
| 60 | +4. **Deploy** |
| 61 | +```bash |
| 62 | +PROJECT_ID=eoAPI STAGE=staging npx cdk deploy vpceoAPI-staging eoAPI-staging |
| 63 | +``` |
| 64 | + |
| 65 | +## Configuration |
| 66 | + |
| 67 | +The deployment is configured through `config.yaml` and environment variables: |
| 68 | + |
| 69 | +- `PROJECT_ID`: Prefix for stack names |
| 70 | +- `STAGE`: Environment name (staging, production, etc.) |
| 71 | +- Database settings, Lambda configuration, and API Gateway options |
| 72 | + |
| 73 | +See [configuration examples](https://github.com/developmentseed/eoapi-template/blob/main/config.yaml.example) for detailed options. |
| 74 | + |
| 75 | +## Components |
| 76 | + |
| 77 | +- **[eoapi-cdk](https://github.com/developmentseed/eoapi-cdk)** - CDK constructs library |
| 78 | +- **[eoapi-template](https://github.com/developmentseed/eoapi-template)** - Example CDK application |
| 79 | + |
| 80 | +## Troubleshooting |
| 81 | + |
| 82 | +**VPC Limits**: If you encounter "max VPCs reached" errors, switch to a different AWS region. |
| 83 | + |
| 84 | +**Permissions**: Ensure your AWS credentials have permissions for Lambda, RDS, API Gateway, and CloudFormation. |
0 commit comments