This demo uses AWS Aurora PostgreSQL with Next.js to fetch movies from the database. It is able to securely connect to Aurora PostgreSQL without using hardcoded access tokens through Vercel's OIDC Federation and RDS IAM authentication.
Demo: TK
- Aurora PostgreSQL cluster with IAM authentication enabled
- Database user with
rds-db-connectpermission - AWS IAM role configured for RDS access
- Create
.env.localfile with required environment variables:
AWS_ROLE_ARN=arn:aws:iam::YOUR_ACCOUNT:role/YOUR_ROLE DB_CLUSTER_ENDPOINT=your-cluster.cluster-xxxxx.region.rds.amazonaws.com DB_USERNAME=postgres DB_NAME=postgres DB_PASSWORD=your-password AWS_REGION=us-east-1 - Install dependencies:
pnpm install- Run migrations to create tables:
pnpm run db:migrate- Seed the database with movie data:
pnpm run db:seed- Start the development server:
pnpm run dev