By using AWS re:Post, you agree to the Terms of Use
/Lambda that parses data into attributes?/

Lambda that parses data into attributes?


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).

is there a way to achieve this?

1 Answers

This tutorial should help you out:

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.

answered 2 months 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