skillfed

sqlalchemy-rdsiam

SQLAlchemy dialects to connect to Amazon RDS instances with IAM authentication

sqlalchemy-rdsiam v1.0.3 81.8K downloads/30d#14,203 on PyPI13
License unclear DORMANT released

What it is and what it does

sqlalchemy-rdsiam is a SQLAlchemy dialect plugin that handles IAM-based authentication for Amazon RDS PostgreSQL databases. Instead of managing database passwords, it integrates with AWS IAM to generate short-lived connection tokens based on your IAM identity. The package supports both synchronous (psycopg2) and asynchronous (asyncpg) PostgreSQL drivers and works with SQLAlchemy 1.3, 1.4, and 2.0.

The dialect eliminates the need to modify your application code or maintain custom event handlers—you simply use a special connection string scheme (postgresql+psycopg2rdsiam:// or postgresql+asyncpgrdsiam://) and let the package handle token generation via boto3. It also offers optional features like automatic database creation, custom AWS region selection, and built-in RDS certificate bundle handling for SSL verification.

Use it for:

  • Connecting to RDS PostgreSQL from applications running on AWS with IAM roles instead of hardcoded database credentials.
  • Integrating RDS access into open-source tools or frameworks without maintaining a fork to inject custom authentication logic.
  • Asynchronous Python applications using asyncpg that need IAM-authenticated RDS connections.
  • Temporary or ephemeral database access where short-lived tokens align with your security model.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides SQLAlchemy dialects for connecting to Amazon RDS PostgreSQL instances using IAM authentication instead of passwords, with support for both psycopg2 and asyncpg drivers.

Yes, with conditions. Install if you need IAM authentication for RDS PostgreSQL and can accept dormant maintenance (last release 2023-11-08). The package is simple, low-friction to install, and solves a real problem without requiring code changes. However, verify that it remains compatible with your SQLAlchemy, psycopg2/asyncpg, and boto3 versions before deploying to production. Clarify the license terms before use in proprietary contexts.

Install

sqlalchemy-rdsiam on PyPI

pip

pip install sqlalchemy-rdsiam

uv

uv add sqlalchemy-rdsiam

poetry

poetry add sqlalchemy-rdsiam

Installing sqlalchemy-rdsiam

Before you install

Low install friction with only two runtime dependencies (SQLAlchemy and boto3). Maintenance is dormant—last release was 2023-11-08, though the repository remains active with a recent commit on 2024-06-26. No active development signals.

License in practice

License treatment is unclear; the raw license field is empty and SPDX is not specified. Verify the actual license terms in the repository before use in proprietary or restricted contexts.

Quickstart

pip install sqlalchemy-rdsiam

from sqlalchemy import create_engine
engine = create_engine('postgresql+psycopg2rdsiam://username@host/dbname')

Requires IAM permissions configured in AWS to connect to the RDS instance; psycopg2 or asyncpg must be installed separately for the chosen PostgreSQL driver.

Verify before relying

  • Whether the package works with SQLAlchemy versions released after 2.0 (fact sheet mentions 1.3, 1.4, 2.0 support but last release was Nov 2023).
  • Current compatibility status with modern versions of psycopg2 and asyncpg given dormant maintenance.
  • Whether the bundled RDS CA certificate is kept current with AWS certificate rotations.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 2 — SQLAlchemy, boto3
Maintenance dormant — 1,010 days since the last release
Last repo commit
First released
Downloads 81,764/month — #14,203 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlalchemy_rdsiam-1.0.3-py2.py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

sqlalchemy rds iam authenticationaws rds postgresql dialectiam database connection sqlalchemyrds psycopg2 asyncpgaws iam token database authrds connection without password
aws-rdsiam-authpostgres

More Database packages

psycopg2-binary

psycopg2-binary is a PostgreSQL database…

copyleft · top 1,000 on PyPI

redis

Python client library for connecting to and…

permissive · top 1,000 on PyPI

ydb

YDB Python SDK is the official client library…

permissive · top 1,000 on PyPI

snowflake-connector-python

Connects Python applications to Snowflake data…

permissive · top 1,000 on PyPI

sqlparse

sqlparse tokenizes SQL text into a tree of…

permissive · top 1,000 on PyPI

dbt-adapters

Provides base adapter protocols and shared…

permissive · top 1,000 on PyPI

sqlalchemy-aurora-data-api

Provides a SQLAlchemy dialect for accessing…

permissive · top 15,000 on PyPI

sqlalchemy-redshift

Provides a SQLAlchemy dialect for Amazon…

permissive · top 5,000 on PyPI

google-cloud-alloydb-connector

Provides secure, IAM-based connections to…

permissive · top 15,000 on PyPI

aurora-data-api

A DB-API 2.0 compatible client for AWS Aurora…

permissive · top 15,000 on PyPI

sqlalchemy-cockroachdb

A SQLAlchemy dialect that enables ORM and SQL…

permissive · top 5,000 on PyPI

aws-psycopg2

Provides psycopg2 with statically linked…

permissive · top 5,000 on PyPI

sqlalchemy-pgspider

Provides a SQLAlchemy dialect that enables…

permissive · top 15,000 on PyPI

aws-advanced-python-wrapper

Wraps Python database drivers to add Aurora…

permissive · top 15,000 on PyPI

cloud-sql-python-connector

Provides IAM-based authentication and encrypted…

permissive · top 5,000 on PyPI

ec2-metadata

Queries the EC2 Instance Metadata Service v2 to…

permissive · top 5,000 on PyPI