This repository contains an AWS CDK template for self-hosting a fully containerized, serverless Bluesky Personal Data Server (PDS) on AWS.
This architecture was designed with resiliency, observability, and security in mind. A single AWS Fargate task sits behind a load balancer that spans two AZs, running in its own VPC. The load balancer terminates TLS, and redirects HTTP to HTTPS. Amazon ECS ensures that only one task is running at a time. In case of an unhealthy task, ECS will terminate the task and start a new one in either of the two AZs.
For monitoring, container logs are sent to Amazon CloudWatch. Alarms are configured in CloudWatch on load balancer metrics and on errors in the logs.
Also see the cost guide to get a rough idea on the cost for self-hosting a PDS using this CDK template, as well as other options for self-hosting on AWS.
Note that Bluesky currently treats federating to self-hosted PDSs as an experimental phase, and is intended for developers and individuals hosting personal or test accounts. Bluesky recommends that you do not migrate your main account yet. See the AT Protocol PDS Admins Discord for the latest guidance.