Lambda that parses data into attributes?

0

I'm sending with ajax, a payload of data and then i have a lambda setup to take that data and parse it into attributes to store into my dynamoDB.

this is my github showing my index.js(lambda function) and my jque.js(file that is sending the data to the lambda via api gateway). https://github.com/dbaldw10/DynamoDWLambdaAWS

is there a way to achieve this?

1回答
1

This tutorial should help you out: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-dynamo-db.html

Your current code appears to do most of this already - you just need to refactor to use a Lambda handler function and get the request body from the event object:

exports.handler = async (event, context) => {
  ...
  let requestJSON = JSON.parse(event.body);
  ...
}

You should then be able to replace the hardcoded values being added to DynamoDB with the data being sent in the request.

Ed
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ