Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take the queue url directly instead of its name #33

Open
artyom opened this issue May 8, 2023 · 1 comment
Open

Take the queue url directly instead of its name #33

artyom opened this issue May 8, 2023 · 1 comment

Comments

@artyom
Copy link

artyom commented May 8, 2023

Taking in the queue name instead of its url is an unfortunate choice, as it takes another SQS API call to figure out the queue url from its name, and this API call is covered by a dedicated permission (sqs:GetQueueUrl).

It would be great to see the change that allows code to take in the preexisting queue url directly instead of its name, and send/receive/delete messages on such a queue relying only on these limited IAM permissions:

  • sqs:ReceiveMessage
  • sqs:DeleteMessage
  • sqs:DeleteMessageBatch
  • sqs:ChangeMessageVisibility
  • sqs:ChangeMessageVisibilityBatch
  • sqs:SendMessage
  • sqs:SendMessageBatch
@allisson
Copy link

A simple hack to fix this:

queue_url = "https://sqs.us-east-1.amazonaws.com/000000000000/my-queue"
queue_name = queue_url.split("/")[-1]
sqs = SQSEnv()
queue = sqs.queue(queue_name)
queue._queue = sqs.sqs_resource.Queue(queue_url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants