# Reference implementation on AWS

> Every AWS service Files uses in Sypnia Cloud, and how.

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

For agents: Files on AWS: CloudFront (API host <ref>.files.sypnia.com) → Lambda engine (API, tus, S3 gateway, MCP); CloudFront content host <ref>.files.sypnia.app with edge signed-URL checks and Lambda transform function; S3 objects under <project>/ with SSE-KMS per project and 7-day versioning; GuardDuty Malware Protection for S3 on scan buckets → EventBridge → scan_status; KMS per project; RDS Postgres (sypnia_files in project DB); CloudWatch.

**Figure**: Sypnia Files on AWS: the API function, the content CDN with the transform function, S3, and the scanning pipeline.

The API runs as a Lambda function behind CloudFront at the project's files address. Objects are in S3 under the project's prefix, encrypted with the project's KMS key. The content host is a second CloudFront distribution in front of S3 and of a transform function. GuardDuty Malware Protection scans new objects in scanning buckets and reports through EventBridge, which updates the object's status.

| Service                                    | Used for                                                                            |
| ------------------------------------------ | ----------------------------------------------------------------------------------- |
| CloudFront (API)                           | `<ref>.files.sypnia.com`, TLS, routing to the engine                                |
| AWS Lambda                                 | the engine (API, tus, S3 gateway, MCP) and the image transform function             |
| CloudFront (content)                       | `<ref>.files.sypnia.app`, cache, signed URL checks at the edge                      |
| Amazon S3                                  | objects, under `<project>/…`, SSE-KMS with the project's key, versioning for 7 days |
| Amazon GuardDuty Malware Protection for S3 | scanning objects in buckets with `scan: on`                                         |
| Amazon EventBridge                         | scan results → the engine updates `scan_status`                                     |
| AWS KMS                                    | one key per project                                                                 |
| Amazon RDS for PostgreSQL                  | `sypnia_files` in the project's database                                            |
| CloudWatch                                 | logs and metrics                                                                    |
