purge_queue.py 218 B

1234567891011121314
  1. """
  2. Task to purge an SQS queue
  3. """
  4. import boto3
  5. from decorators import with_logging
  6. sqs = boto3.resource("sqs")
  7. @with_logging
  8. def handler(event, context):
  9. queue = sqs.Queue(event["QueueUrl"])
  10. queue.purge()