Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Test sending SQS message from role in Cloud9 having send / received message permission to queue but no message received

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:498722974444:general-queue-abc",
            "arn:aws:sqs:eu-west-2:498722974444:individual-queue-${insert-attribute-by-customer-name}"
        ]
    },
    {
        "Sid": "VisualEditor1",
        "Effect": "Allow",
        "Action": "sqs:ListQueues",
        "Resource": "*"
    }
]

}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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
enter image description here

But the queue shows message available

enter image description here

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:

  • I thought my action was to send a message to SQS queue from Cloud9 after assuming the right permission access, and the queue was supposed to have ‘Number of Message Received’ since the queue-url i specified the message to send to is the same queue. I am confused with why no ‘number of message received’ when there’s message available shown.
  • there is no cloudwatch logs that are able to help me to understand anything
  • does this means that the permission actually allows the message sent but there is some issue in the queue receiving the message? (For example access denied?)

thanks in advance

>Solution :

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}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading