# AWS

> The AWS template: Lambda, CloudFront, S3 and RDS or your Postgres in your account.

Applies to: the Sypnia engine (open source, self-hosted).  
Source: https://files.docs.sypnia.com/self-hosting/aws/

For agents: Files AWS template deploy/aws.yaml: Lambda engine behind CloudFront (API), second CloudFront for content with transform function, S3 SSE-KMS, KMS key, RDS or DatabaseUrl; parameters Domain, ContentDomain, CertificateArn, DatabaseUrl, JwksUrl, Scan none|guardduty; use a content domain outside the app domain for cookie safety.

`deploy/aws.yaml` creates in your account: the engine as a Lambda function behind CloudFront (API), a second CloudFront distribution for content with the transform function, an S3 bucket with SSE-KMS, a KMS key, and RDS PostgreSQL or the connection to yours. Parameters: `Domain`, `ContentDomain`, `CertificateArn`, `DatabaseUrl`, `JwksUrl`, `Scan` (`none`, `guardduty`).

```bash
aws cloudformation deploy --template-file deploy/aws.yaml --stack-name sypnia-files   --parameter-overrides Domain=files.example.com ContentDomain=cdn.example.net CertificateArn=arn:aws:acm:…   --capabilities CAPABILITY_IAM
```

Use a content domain that is not a subdomain of your app's main domain, so uploaded files can never read your app's cookies.
