# A reference implementation on AWS, service by service

> Every AWS service Sypnia Data uses, what it does, where the Rust runs, its limits, and what it costs at small scale.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://data.docs.sypnia.com/architecture/reference-implementation-aws/

For agents: AWS deployment of the engine (template sypnia-data-aws.yaml; Sypnia Cloud runs the same shape): CloudFront (wildcard host *.data.example.com, forwards Host, caches only /.well-known/jwks.json for 5 min), one Lambda function (arm64, provided.al2023, the Rust binary, 512 MB, reserved concurrency to protect the database) with a Function URL, Amazon RDS for PostgreSQL (or any Postgres), AWS KMS (one key for envelope encryption of signing keys and credentials), SSM Parameter Store (connection strings, master settings), Amazon SES or another provider (e-mail), CloudWatch (logs 30 days, alarms on errors, throttles, database connections). No VPC, NAT, load balancer or queue required. Idle cost is a few dollars a month plus the database.

This is the deployment the AWS template creates, and the shape Sypnia Cloud runs **\[Cloud]**.

**Figure**: Sypnia Data on AWS. One address, one function running the Rust engine, your database, and managed services around them.

1. Apps, agents and the console call one HTTPS address per project.
2. CloudFront terminates TLS for the wildcard host and forwards the request, host included.
3. One Lambda function runs the engine binary: auth, Data API, SQL and MCP.
4. Postgres holds every project's data, one database per project.

## The services

| AWS service                        | What it does here                                                                                                                                                                                      | Rust or managed                                                      |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| **CloudFront**                     | One HTTPS address per project (`<ref>.data.example.com`, a wildcard certificate), forwards the host so the engine knows the project; caches only the public keys (`/.well-known/jwks.json`, 5 minutes) | Managed                                                              |
| **Lambda**, function `sypnia-data` | Runs the engine: every endpoint                                                                                                                                                                        | **Rust**: the `sypnia-data` binary, arm64, `provided.al2023`, 512 MB |
| **RDS for PostgreSQL**             | Projects' databases. Or any Postgres 14+ of yours                                                                                                                                                      | Managed                                                              |
| **KMS**                            | One key; it encrypts the data keys that encrypt signing keys and stored credentials                                                                                                                    | Managed                                                              |
| **SSM Parameter Store**            | Connection strings and engine settings, as SecureStrings                                                                                                                                               | Managed                                                              |
| **SES** (or your provider)         | Sends auth e-mails; bounces and complaints come back through SNS and suppress the address                                                                                                              | Managed                                                              |
| **CloudWatch**                     | Logs (30 days) and alarms: errors, throttles, database connections near the limit                                                                                                                      | Managed                                                              |
| **IAM**                            | One role for the function, with the least it needs                                                                                                                                                     | Managed                                                              |

Not needed: no VPC, no NAT gateway, no load balancer, no queue, no cache cluster. The database is reached over TLS with strong credentials and a security group; put it in a VPC with the function if your policies require it (then add an SES VPC endpoint).

## Limits that matter

| Service    | Limit                                            | Effect                                                                                              |
| ---------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------- |
| Lambda     | reserved concurrency (default 5 in the template) | caps database connections; raise it with the database size                                          |
| Lambda     | 6 MB response                                    | bigger Data API responses are refused; page instead                                                 |
| CloudFront | 60 s origin timeout                              | SQL statements are capped below it                                                                  |
| RDS        | `max_connections` by instance size               | see [Scaling and connection pooling](https://data.docs.sypnia.com/architecture/scaling-and-pooling) |
| SES        | your account's sending quota                     | the project's e-mail quota sits below it                                                            |

## Cost at small scale

Prices are AWS's public list prices for `us-east-1` on 2026-11-17; recompute before relying on them.

| Item                                    | Idle                    | Per 1 million requests              |
| --------------------------------------- | ----------------------- | ----------------------------------- |
| Lambda (arm64, 512 MB, \~20 ms average) | 0                       | ≈ USD 0.37                          |
| CloudFront                              | 0                       | ≈ USD 1.00 (requests) plus data out |
| KMS                                     | USD 1 per key per month | data keys are cached: near 0        |
| SSM, CloudWatch logs                    | ≈ USD 0.50              | small                               |
| SES                                     | 0                       | USD 0.10 per 1 000 e-mails          |
| RDS `db.t4g.micro`                      | ≈ USD 12 per month      | —                                   |

A small project costs roughly the database plus a dollar or two.
