What is the best way to call AWS SQS from Apigee shared flow (OnPrem)

I need to send the HTTP response from backend to AWS SQS. I am thinking to implement as java call out or using python script in custom policy. But when trying python (boto3), I am getting below error:-

failed with reason: "ImportError: No module named boto3"

I am not able to find the details for import boto3 python library in Apigee (onPrem). is it possible to do it?

Can you please help me with steps? 

Thanks

0 1 477
1 REPLY 1

I don;t know about boto3

but sending to SQS should be pretty simple. It's just a REST call, right?  You need an AWS v4 signature.  Nothing more than that. Right? 

There are callouts that have been discussed here (on the community site) that describe how to generate an AWS signature. 

Search around, you'll find something useful.  [Edit: here's a good one]

Basically, use that callout to produce the right signature for your SQS call, and then send out the call.  For a POST to SQS, the message looks like:

POST /123456789012/MyQueue HTTP/1.1
Host: sqs.us-east-2.amazonaws.com
Content-Type: application/x-www-form-urlencoded

Action=SendMessage
&MessageBody=Your+Message+Text
&Expires=2020-10-15T12%3A00%3A00Z
&Version=2012-11-05
&AUTHPARAMS

And the AUTHPARAMS are what comes out of the callout I linked to above.