Using Lambda Function between AWS IoT Core and Amazon Timestream

0

I want to enhance the sensor data from the IoT core before sending it to Amazon Timestream, but I cannot find a way to manipulate the data between AWS IoT core and Amazon Timestream. Is there any way to pass the data coming from IoT Core through a Lambda function before sending it to Amazon Timestream?

How I want it done

1 Answer
0

For example, in Python, you can use boto3's timestream-write method to write data to a timestream.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/timestream-write.html

Allow the timestream:DescribeEndpoints and timestream:WriteRecords actions in the Lambda role.

https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazontimestream.html

profile picture
EXPERT
shibata
answered a month ago
  • Thanks @shibata I already written and tested my lambda function on the incoming data from IoT rule and it's working as expected. My concern is how to connect the lambda function to the Amazon Timestream. If you click on the 'Add destination' in the lambda function overview, you'll notice there are only SNS, SQS and EventBridge as the only listed destination. So, how do I connect my tested lambda function to the Amazon Timestream? I hope my explanation is clear.

  • Sorry for omitting the screen description.

    The "Add destination" function you are looking at is a setting called destination for asynchronous invocation.

    When processing asynchronously, the caller does not wait for Lambda processing. Therefore, some processing is required to understand the results of Lambda execution. Setting the destination is a feature for easy handling of the results.

    This setting is not necessary for writing to Amazon Timestream. However, in some cases, it may be a good design to pass the result to SQS or other means to re-execute the write process in case it fails.

    https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions