-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambda FunctionZip
doesn't support a stream object
#552
Comments
The logic S3 uses to sign payloads should probably be moved directly into the V4 signer so all services can make use of this logic. A temporary workaround would be to do the following: var lambda = new AWS.Lambda();
var params = { ... };
lambda.uploadFunction(params).
on('build', AWS.S3.prototype.computeSha256).
send(function(data, err) {
console.log(data, err);
}); Let me know if that works for you. Note that it uses a private API, so it should just be a workaround, not permanent code. Note also that stream support will still only work with rewindable/seekable streams (namely file objects), as we must be able to seek the stream to compute a checksum of the body prior to sending. |
In my situation today using a buffer is totally reasonable (although #551 can be a problem with larger buffers), but thanks for the workaround. You suspect this logic will move into the v4 signer relatively soon? |
@rclark yea this should be a fairly easy refactor. I'm just not near my dev machine right now, but it should get looked at this week. |
/cc @AdityaManohar |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
According to the documentation http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Lambda.html#uploadFunction-property
This works fine as long as I provide a buffer object, but if I provide a stream (via
fs.createReadStream
), I get the following error:The text was updated successfully, but these errors were encountered: