- Newest
- Most votes
- Most comments
Under dynamoDBv2 rule the primary partion key and (optional) sort key is expected to be present in the MQTT message paylaod. "The MQTT message payload must contain a root-level key that matches the table's primary partition key and a root-level key that matches the table's primary sort key, if one is defined. which I guess is not the case..." So when creating your table you should define the primary and sort keys from the payload root-level key.
If deviceID and timestamp are part of your topic, you should be able to do what you are looking for.
If deviceID and timestamp are not set as root level topics -and you cannot modify the way the MQTT is being published-, you may need to perform DynamoDB putItem within a lambda function..
An alternative would be to republish (https://docs.aws.amazon.com/iot/latest/developerguide/republish-rule-action.html) the MQTT with modified topics so that they can be automatically processed by dynamoDBv2 rule.
Relevant content
- Accepted Answerasked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago