Log post data using AWS Lambda
<p>I am new to AWS Lambda. I got a working model of lambda function which logs the json data to cloudwatch and also S3 bucket.</p>

<p>This is the function :</p>

<pre><code>exports.handler = function(event, context) {
    var s3 = new AWS.S3();
    var param = {Bucket: 'test', Key: 'test123', Body: event.name};
    console.log("EVENT DATA :" + param.Body);
    s3.upload(param, function(err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else console.log(data);           // successful response

        console.log('actually done!');
        context.done();
    });
    console.log('done?');
};
</code></pre>

<p>This is my json data :</p>

<pre><code>{
  "name": "XYZ ABC",
  "value": 123
}
</code></pre>

<p>How should I push the whole JSON data given above to S3 and CloudFront logs rather than just event.name?</p>

<p>Thanks.</p>