pubsublib is a Python library designed for PubSub functionality using AWS - SNS & SQS.
To get started with pubsublib, you can install it via pip:
pip install pubsublibOnce pubsublib is installed, you can use it in your Python code as follows:
from pubsublib.aws.main import AWSPubSubAdapter
pubsub_adapter = AWSPubSubAdapter(
aws_region='XXXXX',
aws_access_key_id='XXXXX',
aws_secret_access_key='XXXXX',
redis_location='XXXXX',
sns_endpoint_url=None,
sqs_endpoint_url=None
)When using IAM Roles for Service Accounts (IRSA), pass aws_access_key_id and aws_secret_access_key as empty strings so that the AWS SDK uses its default credential provider chain (which will pick up the service account role). You should still provide a valid aws_region here, or ensure that AWS_REGION or AWS_DEFAULT_REGION is set in the environment or shared AWS config when omitting it.