I'm trying to extract mqtt messages from the $aws/things/+/streams/+/data/json topic and republish it to a new topic such as devices/data. The SQL statement I have in the rule is: SELECT * FROM '$aws/things/+/streams/+/data/json'. I'm able to receive messages on the topic I want to republish, but for some reason those messages are not being republished to a new topic I defined in the rule.
The rule works if you change the reserved topic to some other non-reserved topic. As for permissions, this policy gets created by default:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:us-east-1:162502870742:topic/devices/data"
}
}
I tried modifying the policy to allow MQTT messages to be received:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:us-east-1:162502870742:topic/devices/data
},
{
"Effect": "Allow",
"Action": "iot:Receive",
"Resource": "*"
}
]
}
These changes didn't work. What am I missing?