Is it possible to send a message to a SQS Queue upon a HTML website button press?

1.2k views Asked by At

I am trying to find a way to connect SQS with a website.

My general understanding of the project is that when a user clicks a button on the website it will send a message to the queue, and then I will have an Arduino receiving the message, which will then trigger a function that will move a robot. I have played around with Temboo and have managed to receive messages on the Arudino board, but I have no idea if it is even possible to send messages through a HTML button press. Is this even doable?

1

There are 1 answers

1
jarmod On

One way to send messages to SQS from a web browser is to use the AWS JavaScript SDK in the browser. You will need to supply credentials to the browser client so that it can make SDK calls, so ideally your client authenticates to your back-end and your back-end can send temporary (STS) credentials down to the client to use with the SDK.

Or you can use Amplify Pub/Sub, which is a higher-level framework than the AWS SDK.

Another way would be to create a small Lambda function, fronted with API Gateway, and then your browser client can POST to an HTTPS endpoint that will trigger your Lambda function to send the message to SQS.