Socket
Book a DemoInstallSign in
Socket

psycopg2-iam

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

psycopg2-iam

Custom Connection Factory class (RDS, Redshift) with build-in IAM authentication and SSL bundle downloader support.

1.1.0
pipPyPI
Maintainers
1

psycopg2-iam

Custom Connection Factory class (RDS, Redshift) with build-in IAM authentication and SSL bundle downloader support.

Installation

Install package

poetry add psycopg2-iam

Usage

Create connection directly from secret

from psycopg2_iam import connect

conn = connect(secret="secretId")

Using connect function

from psycopg2_iam import connect
connect(dsn="...")

Pass connection factory class to psycopg2.connect()

import psycopg2 
from psycopg2_iam import IAMConnection

psycopg2.connect(dsn="...", connection_factory=IAMConnection)

Create DSN from AWS generated RDS secret

import boto3
import json
import psycopg2 
from psycopg2_iam import IAMConnection, dsn_from_rds_secret

secrets = boto3.client("secretsmanager")
db_secret = json.loads(secrets.get_secret_value(SecretId="/dynks/rds/readonly").get("SecretString"))

psycopg2.connect(dsn=dsn_from_rds_secret(db_secret), connection_factory=IAMConnection)

Keywords

aws

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.