Execution of the get_dynamodb
function of IoT SQL fails with a strange error message when calling it with the four parameters specified in the documentation https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-functions.html.
My rule definition equals
SELECT
*,
get_dynamodb("myTableName", "devEui", WirelessMetadata.LoRaWAN.DevEui, "myRoleArn") AS context
FROM 'myTopic'
WHERE
message.WirelessMetadata.LoRaWAN.FPort = 10
OR message.WirelessMetadata.LoRaWAN.FPort = 32
I have configured fine-grained logging for AWS IoT Core and see the following error message in CloudWatch
{
logLevel: ERROR
reason: ExternFunctionException
status: Failure
timestamp: 2021-12-29 07:12:10.436
details: Function 'GetDynamodb' failed to execute for rule 'XXX'. get_dynamodb takes either 4 or 6 arguments, but 4 given. Expected get_dynamodb(tableName, partitionKeyName, partitionKeyValue, roleArn) or get_dynamodb(tableName, partitionKeyName, partitionKeyValue, sortKeyName, sortKeyValue, roleArn).
eventType: RuleExecution
}
Is there something I'm missing or is the IoT Core SQL function documentation outdated?