I am trying to use the 'newUUID()' aws iot function in the AWS SiteWise service (as part of an alarm action) that returns a random 16-byte UUID to be stored as a partition key for a DynamoDb tables partition key column.

With reference to the attached screenshot, in the 'PartitionKeyValue' trying to use the value returned by newUUID() function that will be passed to the DynamoDb as part of the action trigger.Action_settings_dialog_box

Although this gives an error as follows: "Invalid Request exception: Failed to parse expression due to: Invalid expression. Unrecognized function: newUUID".

I do understand the error, but not sure how can I solve this and use a random UUID generator. Kindly note that I do not want to use a timestamp, because there could be eventualities where multiple events get triggered at the same time and hence the same timestamp.

Any ideas that how can I use this function, or any other information that helps me achieve the above-mentioned.

1

There are 1 best solutions below

0
On

The docs you refer to say that function is all lowercase newuuid().

Perhaps that will work, but I believe that function is only available in IoT Core SQL Statements. I think with event notifications, you only have these expressions to work with, which is not much. Essentially, you need to get what you need from the alarm event itself.

You may need the alarm event to invoke Lambda, rather than directly write to DynamoDB. Your Lambda function can create a UUID and write the alarm record to DynamoDB using the SDKs.