{"size": 540, "ext": "js", "max_stars_repo_path": "Chapter17/apex/event_driven/functions/myCWScheduleToLambdaFunc/index.js", "max_stars_repo_name": "PacktPublishing/Learning-Path-Implementing-AWS-Design-Build-and-Manage-your-Infrastructure", "max_stars_repo_stars_event_min_datetime": "2019-07-17T12:20:15.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-01T17:41:08.000Z", "max_issues_repo_path": "Chapter17/apex/event_driven/functions/myCWScheduleToLambdaFunc/index.js", "max_issues_repo_name": "PacktPublishing/Learning-Path-Implementing-AWS-Design-Build-and-Manage-your-Infrastructure", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Chapter17/apex/event_driven/functions/myCWScheduleToLambdaFunc/index.js", "max_forks_repo_name": "PacktPublishing/Learning-Path-Implementing-AWS-Design-Build-and-Manage-your-Infrastructure", "max_forks_repo_forks_event_min_datetime": "2019-03-13T21:23:25.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-22T08:51:07.000Z"}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": 4, "avg_line_length": 31.7647058824, "max_line_length": 121, "alphanum_fraction": 0.6907407407}
console.log('Loading function');
exports.handler = function(event, context, callback) {
	var csvExport = require('dynamodbexportcsv');
	var exporter = new csvExport(null, null, 'us-east-1');

	exporter.exportTable('LambdaExportToS3', ['userName'], 1, true, 250, 'dynamodb-backup-s3', '04-17-2017', function(err) {
		if(err){
			console.log("An error occurred while exporting the table to s3. The error is: "+err);
			return callback(err);
		}
	  console.log("Succesfully exported the table to S3!");
	  callback(null, "success");
	});
};


