-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
This is a straight repost/migration of the problem report that was originally made at https://forums.aws.amazon.com/thread.jspa?messageID=688330.
When we fetch an SQS queue url via aws sqs get-queue-url
, we receive a deprecated URL.
To whit:
$ aws sqs get-queue-url --queue-name MY_QUEUE --region us-west-2 --output text
https://us-west-2.queue.amazonaws.com/MY_ACCOUNT_ID/MY_QUEUE
According to the SQS web interface, the URL for this queue is actually:
https://sqs.us-west-2.amazonaws.com/MY_ACCOUNT_ID/MY_QUEUE
Normally we wouldn't particularly care about this, except for that when we take the old/deprecated style queue URL (the one that is returned from the aws sqs get-queue-url
command) and try to use it from an Amazon EC2 instance, we get the following error:
[Aws::SQS::Client 403 0.143666 0 retries] receive_message(max_number_of_messages:1,queue_url:"https://us-west-2.queue.amazonaws.com/MY_ACCOUNT_ID/MY_QUEUE",wait_time_seconds:20) Aws::SQS::Errors::SignatureDoesNotMatch Credential should be scoped to a valid region, not 'queue'.
So, basically, we have the aws-cli tools spitting out an SQS queue URL that is invalid/unsable in at least some cases.
We work-around the problem by "crafting" our own queue url as it is currently pretty predictable, but we really think that this should be fixed with aws-cli being updated to return a correct/usable queue url. The Amazon documentation explicitly warns about crafting our own URL, but at this point we don't have a lot of reasonable options left.
For the reference that makes me claim that the queue.amazonaws.com style has been deprecated, see this thread (specifically, look for the post by joel@AWS on 25-Feb-2013): https://forums.aws.amazon.com/thread.jspa?messageID=425255
Thanks!