Is there a way to subscribe AWS sqs to AWS IoT topic ? I see option only for subscribing sqs to SNS topic . We are using IoT device gateway as the message broker and would like SQS subscribe to IoT topic .
0
votes
1 Answers
0
votes
Create a IoT Topic rule with an SQS action. Your rule will look something like this
SELECT * FROM 'your topic here'
Add an SQS action to the rule targeting your SQS queue
You can dynamically select the SQS queue if you can somehow determine the SQS queue url from the topic or data. Use a substitution template in the Action. if the queue name was the 3rd segment of the topic you could do
{
"rule": {
"sql": "SELECT * FROM 'some/topic/+'",
"ruleDisabled": false,
"actions": [{
"sqs": {
"queueUrl": "https://sqs.us-east-1.amazonaws.com/123456789012/${topic(3)}",
"roleArn": "arn:aws:iam::123456789012:role/aws_iot_sqs",
"useBase64": false
}
}]
}
}