AWS Signatures with pm.sendrequest

If I am using pm.sendRequest, how do I go about generating an AWS Signature? I need to create some tests that involve polling an SQS queue to ensure certain messages are delivered. However, that means I need pm.sendRequest to make repeated calls to polls the SQS and delete the messages off. I’m not seeing a way to this.

Don’t use pm.sendRequest for this as you don’t want to compute the signature.

Just reuse a regular Postman request. You can use postman.setNextRequest to retry the same request.

That’s what I’ve done, it just seems kludgy. I am polling an SQS Queue and iterating the messages to make sure I receive what I expect. So I have to basically call the same request in a loop.

How would that be different with pm.sendRequest? You would still be polling, right?

I don’t have the risk of someone doing something as simple and seemingly innocuous as renaming a request breaking the whole loop because setNextRequest expects the request name and doesn’t even seem to fail if you specify an invalid name…

Use the requestId instead of the request name, if this is your concern.
You can get it from the pm.info object.

This is an old thread, but incase anybody finds it and has a similar need here is a solution that worked for me that got posted here

pm.sendRequest({
    url: "https://ssm.eu-central-1.amazonaws.com",
    method: "POST",
    header: {
        'Content-Type': 'application/x-amz-json-1.1',
        'X-Amz-Target': 'AmazonSSM.GetParameter'
    },
    auth: {
        type: "awsv4",
        "awsv4": {
            "accessKey": "$ACCESSKEY",
            "secretKey": "$SECRET",
            "region": "eu-central-1",
            "service": "ssm",
            "sessionToken": "$SESSION_TOKEN"
        }
    },
    body: .....
}, function (err, response) {
    ....
});