Timestream Query running from Lambda

0

Hello: I want to retrieve my Timestream data from API Gateway, so I need to write query code in lambda. I tried the Timestream SDK in Nodejs, and it worked fine running from the CLI. However, trying to replicate same example in AWS Lambda, it runs without errors, but so far, I can't get any data... I was trying to get Query examples to run from Lambda but I couldn't find... Any help would be appreciated.

Regards;

asked 2 years ago2119 views
2 Answers
0

It's tough to tell without knowing the details of your implementation. We do have examples in the Timestream documentation that might help.

AWS
EXPERT
john_l
answered 2 years ago
0

If you are using NodeJS in lambda make sure that your handler is defined as an async function and that the code await on the Timestream API call. (see a generic example here https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html#nodejs-handler-async)

Alternatively use Python with is synchronous. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/timestream-query.html

AWS
EXPERT
answered 2 years ago

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