AWS

Run Directus on AWS Fargate and RDS Aurora serverless using CDK ⛅️

Learn how to create an AWS Cloud Development Kit project to run Directus without servers

Emre Yilmaz
6 min readAug 16, 2023

--

As usual, I wanted to create a side project. This happens every other day, so no big deal 😅 I decided to try Directus as a simple database and a CRUD API this time. It was still a PHP project the last time I used it. Even with PHP, it was quite good 😬

I decided to deploy it to AWS using the Cloud Development Kit, and here I am with a working configuration.

I’ll walk you through the CDK stack step by step. But first, let’s see which services we’ll be using.

  • AWS CDK V2: Nice abstraction over CloudFormation to keep the infrastructure as code.
  • AWS Fargate: The easiest way to run containers without managing servers or clusters.
  • AWS RDS Aurora Serverless PostgreSQL: An easy way to use a PostgreSQL database with potential cost savings.
  • AWS S3: Probably the easiest and cheapest way to store uploaded files.

I need to warn you about something before we start. The RDS can be costly. It could easily cost $3 — $5 a day without use. There are ways to optimize it but a bit tricky with…

--

--