4
votes

I am creating an Alexa skill and I am using Amazon Lambda to handle the intents. I found online several tutorials and decided to use NodeJs with the alexa-sdk. After installing the alexa-sdk with npm, the zipped archive occupied a disksize of ~6MB. If I upload it to amazon, it tells me

The deployment package of your Lambda function "..." is too large to enable inline code editing. However, you can still invoke your function right now.

My index.js has a size of < 4KB but the dependencies are large. If I want to change something, I have to zip it altogether (index.js and the folder with the depencencies "node_modules"), upload it to Amazon and wait till its processed, because online editing isn't available anymore. So every single change of the index.js wastes > 1 minute of my time to zip and upload it. Is there a possibility to use the alexa-sdk dependency (and other dependencies) without uploading the same code continually every time I am changing something? Is there a possibility to use the online-editing function though I am using large dependencies? I just want to edit the index.js.

1
Have you tried using the sam cli, or do you need some aws dependency to test? Sam CLIMartin Calvert
I can test my functions local but the problems appear if I try it with alexa. So offline testing is not a solution for my problem,. I still have to do the upload many times for testing. So I don't think sam cli is a solution(If I understand you and sam cli correctly)Ef Ge
Oh yes for alexa things aren't as easy with sam.Martin Calvert
I'm having the same problem, but with a different npm library. Adding a new node_module bumped my serverless deploy package from 785kb to 3.4Mb and now I can't edit my lambdas online. There's nothing about this limit in the lambda docs either: docs.aws.amazon.com/lambda/latest/dg/limits.html I'm having to change my solution architecture to get around this limitation unhappy faceZodman

1 Answers

0
votes

If the size of your Lambda function's zipped deployment packages exceeds 3MB, you will not be able to use the inline code editing feature in the Lambda console. You can still use the console to invoke your Lambda function.

Its mentioned here under AWS Lambda Deployment Limits

ASK-CLI

ASK Command Line Interface let you manage your Alexa skills and related AWS Lambda functions from your local machine. Once you set it up, you can make necessary changes in your Lambda code or skill and use deploy command to deploy a skill. The optional target will let you deploy the associated Lambda code.

ask deploy [--no-wait] [-t| --target <target>] [--force] [-p| --profile <profile>] [--debug]

More info about ASK CLI here and more about deploy command here