A library to persist messages on S3 using serverless architecture. It is mainly targeted at cheaply archiving low-volume, sporadic events from applications without a need to spin additional infrastructure.
Not a replacement for general logging systems or libraries. Provides no filtering or aggregation.
boto3\ ’s credentials as per:
Make sure you setup:
Take a look at
python3 main.py -h
For example (backup at midnight each Saturday from
app-logs queue to
sqs-s3-logger create -b app-logs-archive -q app-logs -f app-logs-backup -s 'cron(0 0 ? * SAT *)'
Ideally you should use another AWS IAM user with permissions restricted to getting SQS queues and writing messages.
import boto3 sqs = boto3.resource('sqs') queue = sqs.get_queue_by_name(QueueName='<QUEUE_NAME>') queue.send_message(MessageBody='<MSG_BODY_NOT_EXCEEDING_256KB>')
You may need to adjust your CRON settings depending on your volume.
python3 setup.py test
These will use your AWS account to instantiate a temporary integration environment.
.. |Overall idea| image:: assets/graph-overview.png?raw=true : .. _Kinesis Firehose: https://aws.amazon.com/kinesis/firehose/ .. _Cloudwach logs: https://aws.amazon.com/cloudwatch/details/#log-monitoring