jldaws is a Python module that consists of Amazon AWS related scripts. The open-source code can be found on Github: https://github.com/jldupont/jldaws and the Ohloh project page can be found here.
Installation
sudo easy_install jldaws
Setup the environment variables
export AWS_ACCESS_KEY_ID=< access key >
export AWS_SECRET_ACCESS_KEY=< secret key >
export AWS_ACCOUNT_ID=< account id >
You can obtain those keys from the management console.
Scripts
Script " jldexec "
jldexec [-p polling_interval] [-j] [-n] topic python_module_name
This script creates a private SQS queue to which it subscribes to the specified SNS topic.
The SQS queue is polled at polling_interval (seconds).
Optionally with the '-j' switch, the received JSON object can be echoed to stdout.
With the '-n' option, one can specify the maximum number of messages that can be processed at each interval.
Whenever a message is received on the private SQS queue, the specified python_module_name's "run" callable will be called:
python_module.run(private_queue_name, topic_name, received_JSON_message)
Script " jlds3notify "
jlds3notify [ -a ] [ -j ] [-p polling_interval] [-r prefix] bucket_name module_name
This script monitors a specific S3 bucket along with a prefix.
Changes to the bucket/prefix is reported through the "run" function of the specified python module.
The '-a' option is for "always call the run function" even if there are no changes.
The '-j' option is for echoing the generated JSON object to stdout.
python_module.run(bucket_name, prefix, keys={ }, changes=[ ])
Where 'keys' is a dictionary { S3 object name : boto.s3.Key } pairs.
Where 'changes' is a list of S3 object name which changed between polling intervals.
Script " jldtxsqs "
jldtxsqs [-f] [-w] queue_name
This script sends the received JSON string objects from stdin to an SQS queue at the same time as echoing to stdout.
The ' -f ' is useful for flushing the queue at startup.
Use '-w' to receive arbitrary strings.
Script " jldrxsqs "
jldrxsqs [-f] [-w] [-p polling interval] [-n batch_size] queue_name
This script receives a string/JSON objects from an SQS queue and echoes them to stdout.
The ' -f ' is useful for flushing the queue at startup.
Use '-w' to receive arbitrary strings.
Product's homepage
Requirements:
· Python