Created
August 14, 2020 06:21
-
-
Save atheiman/b312ed95c00333483e34864eecf0ee7d to your computer and use it in GitHub Desktop.
Delete SQS message after processing in a Lambda function using Python Boto3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete_message(message): | |
q_region, q_acct_id, q_name = message['eventSourceARN'].split(':')[3:6] | |
sqs = boto3.client('sqs', region_name=q_region) | |
q_url = f'https://{q_region}.queue.amazonaws.com/{q_acct_id}/{q_name}' | |
sqs.delete_message(QueueUrl=q_url, ReceiptHandle=message['receiptHandle']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment