5

I am currently going through the "Quick Start" tutorial for Amazon IoT and I have gotten to the point where I am configuring my rules and test rules. I can see my rules in my aws console under Amazon IoT, along with my thing, cert, and policy. I am using Mosquitto like they suggest for testing it, and I can see my message when I subscribe to my topic.

But I am having an issue that, when I publish a message, I don't see anything in my DynamoDB or the CloudWatch logs from Lambda. And in IoT, I am able to create a resource and see my roles, db table, and lambda function as if it's working. I am keeping to what the tutorial is saying and nothing extra. I can't find any other forum that has discussed Amazon IoT or is having this issue.

mkobit
  • 43,979
  • 12
  • 156
  • 150
jacks205
  • 545
  • 8
  • 19
  • It looks like your Lambda function is not getting invoked. Can you try publishing to an SNS topic? – adamkonrad Oct 12 '15 at 17:41
  • So I added "sns:*" to my policy, and then added a new rule to publish to an SNS topic. I added a new subscription (my email), and when I publish with Mosquitto it worked! I got an email. So I wonder what is happening with the db and Lambda function? – jacks205 Oct 12 '15 at 20:10
  • 1
    @kixorz it's exactly this issue here: https://forums.aws.amazon.com/thread.jspa?messageID=679521򥹡 – jacks205 Oct 14 '15 at 08:18

1 Answers1

5

Found the solution, it was an error in the AWS Quickstart tutorial.

Look at this thread: https://forums.aws.amazon.com/thread.jspa?threadID=217825&tstart=0

  • The range timestamp field must be of type String and not Number
  • The hashKeyValue in the json must be "${topic()}" instead of "${topic(3)}"
jacks205
  • 545
  • 8
  • 19
  • 1
    Although its 9 month old answer but for new reader , ${topic()} save whole topic in primary key , rather one can use particular field from json also to store like ${DeviceId()}. It will store value of field DeviceId coming in json as primaryKey – umesh Apr 29 '16 at 21:18