Created
December 22, 2021 14:43
-
-
Save serkan-ozal/e2843f20508e747aaef16f684e28ea3b 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
const AWS = require('aws-sdk'); | |
const dynamodb = new AWS.DynamoDB(); | |
exports.hello = async (event, context) => { | |
const promises = []; | |
for (let i = 0; i < 1000; i++) { | |
const params = { | |
TableName: 'books', | |
Item: { | |
'id': {S: i.toString()}, | |
'name': {S: `Book-${i}`} | |
} | |
}; | |
const promise = dynamodb.putItem(params).promise(); | |
promises.push(promise); | |
} | |
return Promise.all(promises); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment