Search code examples
amazon-web-serviceshttpgetpostmanamazon-sqs

Cant add message to AWS SQS using Postman - AcessDenied?


I am trying to add a message to my SQS using Postman.

When I try the following on Postman:

GET    https://sqs.us-east-1.amazonaws.com/205115639995/myQueue.fifo?Action=SendMessage&MessageBody={"message":"test1}

I get:

<?xml version="1.0"?>
<ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
    <Error>
        <Type>Sender</Type>
        <Code>AccessDenied</Code>
        <Message>Access to the resource https://sqs.us-east-1.amazonaws.com/205115639995/myQueue.fifo is denied.</Message>
        <Detail/>
    </Error>
    <RequestId>80ddb4e8-5eff-5143-adf6-e39d5cb46aa2</RequestId>
</ErrorResponse>

I have my AWS ACCESS and SECRET keys saved in my environment variables and they are correct.

What could be the issue here? Do I need to add my KEYS to the request?


Solution

  • The AWS credentials are picked up by AWS provided tools like AWS CLI, Boto3 (python) etc. They look at various places like environment variables, the credentials files that are generated by aws configure etc

    Postman is not a AWS property, so this lookup logic is not built in. This is the reason why you are facing the issue. There's a little bit of configuration that is needed to let Postman know that you want to use AWS credentials for a particular API calls.

    1. Head over to the "Auth" tab when editing the Request.
    2. From the "Type" dropdown, select "AWS Signature"
    3. Here you will find a place to add your accesskey and secretkey as well as other optional parameters like region.
    4. All set, if the service you are trying to connect to is publicly accessible, and the credentials you are using has a policy in place to access the service, you should now be authenticated to access it.

    Image for your reference: Postman AWS Signature