如何在AWS Lambda中添加可执行程序包 [英] How to add executable packages in AWS Lambda

查看:318
本文介绍了如何在AWS Lambda中添加可执行程序包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在aws lambda上添加gcc,g ++或jdk等可执行程序包,然后执行我们的lambda函数.

Is there any way to add executable packages like gcc, g++ or jdk on aws lambda and then execute our lambda function.

推荐答案

来自 https://aws.amazon.com/blogs/compute/running-executables-in-aws-lambda/:

包含您自己的可执行文件很容易;只需将它们打包在您上载的ZIP文件中,然后在从Node.js或以前启动的其他进程中调用它们时就引用它们(包括创建的ZIP文件中的相对路径).确保在功能代码的开头包含以下内容:

Including your own executables is easy; just package them in the ZIP file you upload, and then reference them (including the relative path within the ZIP file you created) when you call them from Node.js or from other processes that you’ve previously started. Ensure that you include the following at the start of your function code:

process.env['PATH'] = process.env['PATH'] + ':' + process.env['LAMBDA_TASK_ROOT']

这篇关于如何在AWS Lambda中添加可执行程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆