A Step-by-Step Guide.

Deploy a PostgreSQL RDS Instance with AWS CDK

Part 1 of the series of CDK Infrastructure As Code (IAC)

mim Armand
5 min readSep 16, 2023

--

Embarking on a project with AWS CDK to query a PostgreSQL RDS database using Athena? You might find, like I did, that the journey is not as straightforward as it seems, especially with the existing gaps in AWS documentation.

But worry not! I’ve simplified the process for you in this hands-on guide. Here, I will walk you through creating a small and isolated PostgreSQL RDS instance using AWS CDK. It’s a perfect setup for experiments and temporary use cases, with easy clean-up steps to avoid any post-experiment hassle.

So, if you’re looking to dip your toes into using AWS CDK for PostgreSQL RDS, this guide is your starting point. Let’s dive in!

Step 1:

Ensure AWS CLI and CDK command lines are installed and your environment (node, npm), and AWS credentials are set up. We will not cover those here!

Step 2:

Initiate a CDK project:

cd ~/Desktop # creating the project in your desktop!
mkdir psql-cdk
cd psql-cdk
cdk init app --language=typescript

Step 3:

--

--

mim Armand

Sr Solutions Architect / Technology evangelist and Consultant / Teacher of the Full-Stack Web development courses at Washington University in st. Louis