I have been using the Alexa sdk and was able to edit the code using the online code editor since i loaded the boiler plate - alexa skills kit sdk. But then i suddenly needed to use the request module which i cannot directly npm install . So i created the folder structure and uploaded but the problem is i am NOT able to use the inline code editor , if i need to make any small change i ll have to edit the code and upload the whole zip again which is a tedious process if i need to test for small changes and is consuming a lot of time . Please help me find another way. Any help is appreciated . Thanks !
Asked
Active
Viewed 271 times
0
-
Why do you have to recreate the zip file after editing in the console? Have you tried it? – Michael - sqlbot Jun 06 '18 at 23:13
-
If you upload a zip file > 10 mb , U cant edit it in the Console . After uploading the zip file i am not able to EDIT , thats the thing . I know the file > 10 mb because the node modules for alexa sdk is itself around 30mb – Aashrith Chilkepalli Jun 07 '18 at 01:32
-
I wasn't thinking about the impact of the size... but the SDK should be built in to the execution environment. I don't think you need to include that in your deployment. – Michael - sqlbot Jun 07 '18 at 11:48
-
1@Michael-sqlbot , Thats the thing the SDK is not built into the deployment , I tried running the function without uploading the SDK , was not able to ! – Aashrith Chilkepalli Jun 07 '18 at 13:15
-
That's also interesting. I've definitely edited Alexa handlers in the console, but have spent very little time doing so, and as I recall it was a very simple "hello world" that probably had no 3rd party dependencies. – Michael - sqlbot Jun 07 '18 at 13:24
-
I use Python as runtime environment for my Lambda, and I didn't upload anything it works fine for me. You can try the `aws cli`, it is comparitively faster way of updating your lambda function. You need to do `aws configure` first (https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) then see this shell file I made it worked for me : https://github.com/Nikhil-Wagh/Alexa-WhatsTrending/blob/master/upload.sh – Nikhil Wagh Jun 08 '18 at 07:11
-
@NikhilWagh Even i automated using a script that zips everything and pushes to lambda . But it takes around 20-25 seconds . If the inline coding editor would have worked with zip files > 10 MB it would have made it much much easier and faster . So AWS Cli is the only way ? – Aashrith Chilkepalli Jun 08 '18 at 14:24
-
Sometimes you've to play by the rules. It is clearly stated that for files larger than 10 MB consider using s3 bucket. I understand the trouble here. You've to compress all the files then upload the zip, update lambda function, and then it tells you, you've a syntax error. Been there! Although there is another way of tackling the situation. You can locally test your lambda function, and when everything is as expected you could push it then. – Nikhil Wagh Jun 08 '18 at 15:45
-
For node.js you can use `ask-cli`, see this https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html and for Python you can use `python-lambda-local` see this https://github.com/HDE/python-lambda-local . – Nikhil Wagh Jun 08 '18 at 15:49
-
Also for `python-lambda-local` you'll need to make a even.json file, against which you'll test the output. You can find the input for this `event.json` file in your Alexa Skill builder's test section. When you invoke your skill it generates the JSON input, copy and paste it into your file and test it using this : `python-lambda-local -f lambda_handler -t 10 lambda_function.py .event.json` – Nikhil Wagh Jun 08 '18 at 15:50
-
And if you're using `Node.js` see this tutorial: https://youtu.be/p-zlSdixCZ4 – Nikhil Wagh Jun 08 '18 at 15:51