Skip to content

AWS Client Hub

Centralized AWS client and configuration management.


AwsClientHub

Python
AwsClientHub(env_path: Optional[str] = None, **kwargs)

Singleton manager for AWS clients and secrets, with optional SSH tunneling.

This class wraps configuration loading, boto3 session management, and RDS/S3/SecretsManager clients.

Initialize the AwsClientHub singleton.

config

Python
config: _ConfigurationManager

Loaded configuration object.

db

Python
db

Postgres connection (via psycopg2) with optional SSH tunnel.

db_uri

Python
db_uri: str

Constructed Postgres URI from loaded secret.

lambda_client

Python
lambda_client

Return a boto3 Lambda client.

s3

Python
s3

Return a boto3 S3 client.

secretmanager

Python
secretmanager

Return a boto3 SecretsManager client.

session

Python
session

Return a cached boto3 Session.

get_secret

Python
get_secret(secret_id: str = None) -> Union[dict, str, None]

Retrieve a secret by ARN or default from config.

RETURNS DESCRIPTION
Union[dict, str, None]

Parsed dict or raw secret string

reload_config

Python
reload_config(env_path: Optional[str] = None, **kwargs)

Reload configuration and secrets using a given .env path or kwargs.