{"id":27416,"library":"sqlalchemy-rdsiam","title":"SQLAlchemy IAM Auth for RDS","description":"SQLAlchemy dialects for connecting to Amazon RDS instances using IAM database authentication. Requires boto3 and SQLAlchemy. Version 1.0.3 (latest), maintains compatibility with Python 3.6+. Low release cadence, currently maintained by Cisco.","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/cisco-open/sqlalchemy-rdsiam","tags":["sqlalchemy","aws","rds","iam","database-authentication"],"install":[{"cmd":"pip install sqlalchemy-rdsiam","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Core dependency (>=1.3)","package":"sqlalchemy","optional":false},{"reason":"AWS SDK for IAM authentication","package":"boto3","optional":false},{"reason":"PostgreSQL driver (if using postgresql+iam)","package":"psycopg2-binary","optional":true},{"reason":"MySQL driver (if using mysql+iam)","package":"pymysql","optional":true}],"imports":[{"note":"create_engine is from SQLAlchemy core, not this library.","wrong":"from sqlalchemy_rdsiam import create_engine","symbol":"create_engine","correct":"from sqlalchemy import create_engine"}],"quickstart":{"code":"import os\nfrom sqlalchemy import create_engine\n\nengine = create_engine(\n    \"postgresql+iam://dbuser@host:5432/mydb\",\n    connect_args={\n        \"aws_access_key_id\": os.environ.get('AWS_ACCESS_KEY_ID',''),\n        \"aws_secret_access_key\": os.environ.get('AWS_SECRET_ACCESS_KEY',''),\n        \"region\": \"us-east-1\"\n    }\n)\n# Example query\nwith engine.connect() as conn:\n    result = conn.execute(\"SELECT 1\")\n    print(result.fetchone())","lang":"python","description":"Connect to RDS PostgreSQL with IAM auth using the 'postgresql+iam' dialect."},"warnings":[{"fix":"Add sslmode='require' to connection parameters or use sslrootcert.","message":"The 'postgresql+iam' dialect does not support SSL certificate verification by default; ensure your RDS instance enforces IAM auth with SSL.","severity":"breaking","affected_versions":"all"},{"fix":"Verify your database is PostgreSQL or MySQL.","message":"The dialect only supports PostgreSQL and MySQL. Using it with other databases raises NotImplementedError.","severity":"gotcha","affected_versions":">=1.0.1"},{"fix":"Use a custom connection pool or recreate engine periodically.","message":"IAM tokens expire after 15 minutes; the library does NOT automatically refresh. Long-lived connections must handle token renewal.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the library: pip install sqlalchemy-rdsiam","cause":"The 'postgresql+iam' dialect is not registered because sqlalchemy-rdsiam is not installed or imported.","error":"sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgresql.iam"},{"fix":"Use one of: 'postgresql+iam' or 'mysql+iam'.","cause":"Using an unsupported database type (e.g., mysql+iam instead of mysql, or oracle+iam).","error":"NotImplementedError: flavour not supported"},{"fix":"Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables, or pass them in connect_args.","cause":"AWS credentials not provided or not configured in environment.","error":"boto3.exceptions.NoCredentialsError: Unable to locate credentials"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}