Skip to content

AWS RDS Postgres Setup Guide

Overview

Amazon RDS provides managed PostgreSQL (or Aurora PostgreSQL) instances. PostgreSQL is an alternative to MySQL for projects requiring advanced SQL features, JSON support, or PostGIS.

Instance Configuration

SettingSandboxProduction
EnginePostgreSQL 16+ or Aurora PostgreSQLAurora PostgreSQL (recommended)
TemplateFree Tier or Dev/TestProduction
Instance Classdb.t3.micro or db.t4g.microBased on workload
Storage20 GB General Purpose SSDAuto-scaling
Multi-AZNoYes
Public AccessYes (if Lambda outside VPC)Depends on architecture

Database User Strategy

UserPrivilegesUsed By
Admin (master)Full controlDatabase administration
Application userSELECT, INSERT, UPDATE, DELETE on application schemaLambda functions
Read-only userSELECT onlyReporting, monitoring

Local Development

The framework's Docker Compose provides a local Postgres instance:

bash
docker compose -f docs/dev/docker-compose.yml up postgres -d

Default local credentials:

  • Host: localhost:5432
  • Database: app_dev
  • User: dev_user
  • Password: dev_password

Administration Tools

  • pgAdmin (GUI)
  • DBeaver (cross-database GUI)
  • psql CLI

Security

  • Create dedicated application users with minimal privileges
  • Enforce SSL connections in production
  • Store all credentials in SSM Parameter Store, actual values in __dev__/secrets/

Released under the MIT License.