Opening this issue just as a marker for anyone else who runs in to it...
I just ran grunt deploy and ended up getting the error:
Package upload failed, check you have lambda:UpdateFunctionCode permissions.
The actual err returned in the lambda.updateFunctionCode callback was toString failed, which happens when a buffer exceeds kMaxLength.
This is probably because the dist folder is not in your .npmignore file. The zip file has exceeded the max size of a buffer and the AWS SDK is choking on it.
Either add dist to .npmignore or clean out your dist folder.
If your package really does exceed the maximum buffer size (which sounds like it's around 2GB right now), then you'll likely need to upload to an S3 bucket first, as AWS.lambda.updateFunctionCodedoesn't seem to support streams.
Opening this issue just as a marker for anyone else who runs in to it...
I just ran
grunt deploy
and ended up getting the error:Package upload failed, check you have lambda:UpdateFunctionCode permissions.
The actual
err
returned in thelambda.updateFunctionCode
callback wastoString failed
, which happens when a buffer exceeds kMaxLength.This is probably because the dist folder is not in your .npmignore file. The zip file has exceeded the max size of a buffer and the AWS SDK is choking on it.
Either add dist to .npmignore or clean out your dist folder.
If your package really does exceed the maximum buffer size (which sounds like it's around 2GB right now), then you'll likely need to upload to an S3 bucket first, as
AWS.lambda.updateFunctionCode
doesn't seem to support streams.