I was using Cloud9 to assume a role to test on the dynamic permission to send message to a queue.
In cloud9, i assumed this role with the following permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"sqs:DeleteMessage",
"sqs:ReceiveMessage",
"sqs:SendMessage",
"sqs:GetQueueAttributes"
],
"Resource": [
"arn:aws:sqs:us-west-2:{accountID}:general-queue-abc",
"arn:aws:sqs:eu-west-2:{accountID}:individual-queue-${insert-attribute-by-customer-name}"
]
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "sqs:ListQueues",
"Resource": "*"
}
]
}
After assuming and verifying the right role was assumed, i use cli to send message to the queue, it succeeded with the output
{
"MD5OfMessageBody": "dummyNumbers",
"MessageId": "dummyNumbers" }
Expected: SQS to show as 1 message received since the message sent request succeeded.
What I saw instead - Number Of Messages Sent increased but no Number Of Messages Received
But the queue shows message available
My command
aws sqs send-message --queue-url https://sqs.{REGION}.amazonaws.com/{AccountID}/individual-queue-{insert-attribute-by-customer-name} --message-body "I am sending a new message...."
Question:
thanks in advance
Sounds like you have sent 2 messages but haven't received (i.e. read from the queue) any. Try running the following to receive a message:
aws sqs receive-message --queue-url https://sqs.{REGION}.amazonaws.com/{AccountID}/individual-queue-{insert-attribute-by-customer-name}