AWS_SQS module
- AWS_SQS.watch_sqs(sqs_url, waittime=0, region='us-east-1', purge_queue=False)
Monitor an SQS for new messages. This is a blocking function that will wait until an SQS message appears.
- Return type:
list
- Parameters:
sqs_url (str) – The url of the SQS to monitor.
waittime (int, optional) – Time in seconds to wait for querying the SQS for new messages. The default is 0.
region (str, optional) – AWS region the SQS is in. The default is ‘us-east-1’.
purge_queue (bool, optional) – If true, each time a message is found, the entire SQS will be purged of all messages before proceeding. This is useful if you have many workers that could submit messages to the SQS, but you only want 1 downstream job to trigger. The default is False.
- Returns:
SQS messages.
- Return type:
list
- AWS_SQS.create_sqs_s3(queue_name, account_number, s3_bucket_name)
Create an SQS that accepts notifications from S3 bucket triggers. Note this function uses the SDK and is expected to be replaced with CDK in the future.
- Return type:
dict
- Parameters:
queue_name (str) – Name of the SQS
account_number (str) – Account where the SQS will be created.
s3_bucket_name (str) – Name of the s3 bucket to accept messages from.
- Returns:
SQS queue attributes.
- Return type:
dict
- AWS_SQS.delete_sqs(queue_name)
Delete an SQS. Note this function uses the SDK and is expected to be replaced with CDK in the future.
- Return type:
None
- Parameters:
queue_name (str) – Name of the SQS to delete.
- Return type:
None