I want to generate pre-signed S3 links for existing objects in the bucket in bulk.
To achieve this, I can run S3.getSignedUrl()
in a loop but I am not sure if this function runs locally or makes an API call to AWS.
This post says it is done locally, but this is not mentioned anywhere in the documentation.
How can I verify that it doesn't make an external API call?
I am using aws-sdk-js
package.
I went through the actual implementation of the getSignedUrl from the SDK:
function getSignedUrl(operation, params, callback) {
params = AWS.util.copy(params || {});
var expires = params.Expires || 900;
if (typeof expires !== 'number') {
throw AWS.util.error(new Error(),
{ code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires });
}
delete params.Expires; // we can't validate this
var request = this.makeRequest(operation, params);
if (callback) {
AWS.util.defer(function() {
request.presign(expires, callback);
});
} else {
return request.presign(expires, callback);
}
}
Here, a request is being created. Does it make an external API call?