IoT user
IoT user

Reputation: 1300

AWS IoT rule DynamoDB

I have created a rule in AWS IoT.

This rule is very simple: AWS IoT receive a message from MQTT device and storage it in a DynamoDB table.

The problem is that the system receive without problem the message but after that the rule does not sent it to DynamoDB.

This is my topic

Topic

This is my rule

rule1

rule2

This is what I can see in CloudWatch (not sure if this is about the same problem)

CloudWatch

what could be wrong?

Thanks!

Upvotes: 0

Views: 455

Answers (2)

Jovel
Jovel

Reputation: 326

When you use custom Topics, it has to be updated in your policy click 'edit policy document' and add your topic and topic filter under resources.

Upvotes: 0

IoT user
IoT user

Reputation: 1300

The solution is to publish the message in JSON format from Mosquitto:

  mosquitto_pub --cafile rootCA.pem --cert certificate.pem.crt --key private.pem.key -h XXXXX.iot.eu-west-2.amazonaws.com -p 8883 -q 1 -d -t topic -m {\"message\":\"3\"}

where message have to be the name of the primary key

Upvotes: 1

Related Questions