Open nRewik opened 1 year ago
Use case: get (and work with) queue by name.
sqs = boto3.resource('sqs') queue = sqs.get_queue_by_name(...)
Problem: Error when executing code on Lambda due to missing "GetQueueUrl" permission in autogen policy.
Workaround: Forcing autogen policy to attach GetQueueUrl via sqs_client.get_queue_url(...) API.
GetQueueUrl
sqs_client.get_queue_url(...)
sqs = boto3.resource('sqs') sqs_client = boto3.client('sqs') queue_url = sqs_client.get_queue_url(QueueName='<queue_name>')['QueueUrl'] queue = sqs.Queue(url=queue_url)
Use case: get (and work with) queue by name.
Problem: Error when executing code on Lambda due to missing "GetQueueUrl" permission in autogen policy.
Workaround: Forcing autogen policy to attach
GetQueueUrl
viasqs_client.get_queue_url(...)
API.