简体   繁体   English

我们可以将本地创建的 lambda function 导入 AWS 控制台吗?

[英]Can we import our locally created lambda function to AWS console?

I have been working on AWS Lambda.我一直在研究 AWS Lambda。 For some reason, I had to create a Lambda function locally.出于某种原因,我不得不在本地创建一个 Lambda function。 I just want to know, can we import local lambda function to aws lambda console.我只是想知道,我们可以将本地 lambda function 导入到 aws lambda 控制台。 If yes then please elaborate how can i achieve this?如果是,请详细说明我该如何实现?

Yes you can.是的你可以。 Assume you create the Lambda function using the Java run-time API ( com.amazonaws.services.lambda.runtime.RequestHandler ) and you create a FAT JAR that contains all of the required dependencies. Assume you create the Lambda function using the Java run-time API ( com.amazonaws.services.lambda.runtime.RequestHandler ) and you create a FAT JAR that contains all of the required dependencies. You can deploy the Lambda function (the JAR) using the AWS Management Console, as described in this AWS tutorial.您可以使用 AWS 管理控制台部署 Lambda function(JAR),如本 AWS 教程中所述。

Creating an AWS Lambda function that detects images with Personal Protective Equipment 创建使用个人防护设备检测图像的 AWS Lambda function

It is pretty easy:这很容易:

  1. Write your lambda function with a lambda_handler使用 lambda_handler 编写 lambda function
  2. Create a requirements.txt创建一个 requirements.txt
  3. Install all the requirements in the same folder将所有需求安装在同一个文件夹中
  4. Package it(Zip file). Package 它(压缩文件)。
  5. Go to AWS Lambda --> Create function --> Fill all details --> Create function. Go 到 AWS Lambda --> 创建 function --> 填写所有详细信息 --> 创建 ZC1C425268E68385D14A0.
  6. Under code section: upload from -->.zip file ---> (select your file) --> upload--> save在代码部分下:从-->.zip 文件上传-->(选择您的文件)--> 上传--> 保存
  7. Modify the handler according to your function name.根据您的 function 名称修改处理程序。

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

相关问题 我们可以在不使用 AWS Sam 的情况下在本地设置 AWS Lambda function 吗? - Can we set up AWS Lambda function locally without using AWS Sam? AWS Lambda 函数可以在本地运行时导入模块,但在部署时不能导入 - AWS Lambda Function can import a module when run locally, but not when deployed 我们可以将本地创建的 lambda 连接到本地 dynamodb 吗? - Can we connect locally created lambda to local dynamodb? 我们可以在不部署的情况下在本地运行 AWS lambda 吗? - Can we run an AWS lambda locally without deployment? AWS Lambda 函数无法导入 paramiko - AWS Lambda function can't import paramiko Terraform Update 在 AWS 控制台上创建了一个现有的 Lambda 函数 - Terraform Update an existing Lambda function was created on AWS console 在AWS中实施Lambda时可以导入特定版本的Botocore吗? - can we import specific version of botocore when implement Lambda in AWS? AWS lambda function 容器在本地工作但不在 aws 上 - AWS lambda function with container working locally but not on aws AWS中的Lambda开发-? 在当地发展? 或使用AWS Web控制台 - Lambda development in AWS -? develop locally? or use AWS web console 我们是否应该从代码中调用aws lambda函数? - Shall we invoke aws lambda functions from our code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM