Last active
June 5, 2018 19:56
-
-
Save ShakataGaNai/6027b4c684c294f3fcef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { | |
console.log("Request received:\n", JSON.stringify(event)); | |
console.log("Context received:\n", JSON.stringify(context)); | |
var tableName = "OurBlogDemo"; | |
var datetime = new Date().getTime().toString(); | |
dynamodb.putItem({ | |
"TableName": tableName, | |
"Item": { | |
"device": { | |
"S": event.device | |
}, | |
"timedate": { | |
"N": datetime | |
}, | |
"latitude": { | |
"N": event.lat | |
}, | |
"longitude": { | |
"N": event.lon | |
} | |
} | |
}, function(err, data) { | |
if (err) { | |
context.fail('ERROR: Dynamo failed: ' + err); | |
} else { | |
console.log('Dynamo Success: ' + JSON.stringify(data, null, ' ')); | |
context.succeed('SUCCESS'); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Im trying to pass some params like this,
but when it comes to table,
format: {
bitrate: r.format.bitrate
}
it comes as empty.
Any idea why?
helps would be appreciated.