简体   繁体   English

使用alexa-sdk在线编辑Amazon Lambda函数

[英]Online-Edit Amazon Lambda function with alexa-sdk

I am creating an Alexa skill and I am using Amazon Lambda to handle the intents. 我正在创建一个Alexa技能,我正在使用Amazon Lambda来处理意图。 I found online several tutorials and decided to use NodeJs with the alexa-sdk. 我在网上找到了几个教程,并决定将NodeJs与alexa-sdk结合使用。 After installing the alexa-sdk with npm, the zipped archive occupied a disksize of ~6MB. 在用npm安装alexa-sdk之后,压缩的存档占用了大约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. Lambda函数“...”的部署包太大,无法启用内联代码编辑。 However, you can still invoke your function right now. 但是,您现在仍然可以调用您的功能。

My index.js has a size of < 4KB but the dependencies are large. 我的index.js的大小<4KB但依赖性很大。 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. 如果我想要改变一些东西,我必须完全压缩它(index.js和具有依赖性“node_modules”的文件夹),将其上传到亚马逊并等待其处理,因为在线编辑不再可用。 So every single change of the index.js wastes > 1 minute of my time to zip and upload it. 因此,index.js的每一次更改都浪费了> 1分钟的时间来压缩和上传它。 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? 有没有可能使用alexa-sdk依赖(和其他依赖),而不是每次我改变某些东西时不断上传相同的代码? Is there a possibility to use the online-editing function though I am using large dependencies? 虽然我使用大型依赖项,是否有可能使用在线编辑功能? I just want to edit the index.js. 我只想编辑index.js。

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. 如果Lambda函数的压缩部署包的大小超过3MB,您将无法使用Lambda控制台中的内联代码编辑功能。 You can still use the console to invoke your Lambda function. 您仍然可以使用控制台来调用Lambda函数。

Its mentioned here under AWS Lambda Deployment Limits 它提到这里下AWS LAMBDA部署限制

ASK-CLI ASK-CLI

ASK Command Line Interface let you manage your Alexa skills and related AWS Lambda functions from your local machine. 通过ASK命令行界面,您可以从本地计算机管理Alexa技能和相关的AWS Lambda功能。 Once you set it up, you can make necessary changes in your Lambda code or skill and use deploy command to deploy a skill. 设置完成后,您可以对Lambda代码或技能进行必要的更改,并使用deploy命令部署技能。 The optional target will let you deploy the associated Lambda code. 可选target将允许您部署关联的Lambda代码。

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

More info about ASK CLI here and more about deploy command here 更多关于ASK CLI 在这里 ,更多的是deploy命令这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM