Sometimes you want to simulate an API Gateway payload with a local Lambda against a real instance of remote DynamoDB hosted in AWS. This allows you to debug and build up unit tests with real data. In addition, we will see how these can later be used in the integration test.
Running and debugging your AWS Lambda code locally
Batch-loading data into DynamoDB
We will first discuss how to batch-load data into DynamoDB from a comma-separated values (CSV) file called sample_data/dynamodb-sample-data.txt. Rather than insert an individual statement for each item, this is a much more efficient process, as the data file is decoupled from the Python code:
EventId,EventDay,EventCount
324,20171010,2
324,20171012,10
324,20171013,10
324,20171014,6
324...