Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/buildS3VersionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ function getVersion(params) {
s3DataContents = s3DataContents.concat(contents.DeleteMarkers);
if (data.IsTruncated) {
params.VersionIdMarker = contents.NextVersionIdMarker;
params.KeyMarker = contents.NextVersionIdMarker;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this line not be
params.KeyMarker = contents.NextKeyMarker;

recursiveCall(params);
} else {
s3DataContents = s3DataContents.filter((elm) => { return elm.Size > 0 })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do this - this will remove items which need to be deleted.

deferred.resolve(s3DataContents);
}
}
Expand Down Expand Up @@ -129,7 +131,9 @@ function getVersion(params) {
runDeltaOnly = params.runDelta || false;
}

s3 = new AWS.S3();
s3 = new AWS.S3(
{signatureVersion: 'v4'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression AWS SDK handles this automatically, although I may have missed something - can you explain why we need to specify the signatureVersion to v4?

);

var deferred = q.defer();

Expand Down
8 changes: 7 additions & 1 deletion lib/s3ToDynamo.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ function s3ToDynamoDb(params, versionList) {
dParams.RequestItems[destTableName].push(action);
}
console.time('P2D' + version.Key);

dynamoDb.batchWriteItem(dParams, function(err, data) {

console.timeEnd('P2D' + version.Key);
if (err) {
return deferred.reject(err);
Expand All @@ -101,8 +103,12 @@ function s3ToDynamoDb(params, versionList) {
deferred.reject(error)
}

s3 = new AWS.S3();
s3 = new AWS.S3(
{signatureVersion: 'v4'}
);
console.log("DynamoDB params:")
console.log(params);
params['signatureVersion'] = 'v4';
dynamoDb = new AWS.DynamoDB(params);

s3Bucket = params.bucket || '';
Expand Down