2 Answers
- Newest
- Most votes
- Most comments
2
Hi,
please check CloudWatch logs for details about your rule execution (logging must be enabled for AWS IoT Core).
Your payload has temperature and humidity as keys. What is your primary key in DynamoDB? Every primary key identifies every item uniquely. Temperature or humidity can have the same value over time and cannot be considered to be unique.
To generate a unique key from your SQL statement you could use something like
SELECT newuuid() as prim_key, * FROM 'mytopic'
Cheers,
Philipp
0
I added the variable "Time" to my message and set it as my partition key and finally I have data in my table.
answered 2 years ago
Relevant content
- Accepted Answerasked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 8 months ago
I configured IoT to be monitored on CloudWatch and I didn't find any errors.
I changed the as suggested, SQL: SELECT newuuid() as prim_key, *
but still no items identified in the table.
I'm using dynamodbv2.
Hi. How to enable logging: https://docs.aws.amazon.com/iot/latest/developerguide/configure-logging.html. This will then create log streams in a CloudWatch log group called AWSIoTLogsV2. Rule execution logs you should see: https://docs.aws.amazon.com/iot/latest/developerguide/cwl-format.html#log-rules-rule-ex.
This tutorial should steer you in the right direction for the rule, payload enrichment and DynamoDB (even though it's the V1 action, the principles are similar): https://docs.aws.amazon.com/iot/latest/developerguide/iot-ddb-rule.html
What is the primary key of you DynamoDB table? Do you see in CloudWatch that your rule is triggered? If yes, what is the result when the rule is being triggered?
I created a group of logs as suggested, I didn't see any occurrence, I added the variable "Tempo" and set it as my primary key and apparently it solved my problem, thank you all for your attention, very grateful to you.