简体   繁体   中英

Upload zip file to AWS Lambda using Java

Is there an AWS Java method to upload the zip file to AWS Lambda? All examples either use CLI aws or upload via the website.

您可以使用AWSLambdaClient类的createFunctionupdateFunctionCode方法使用AWS SDK for Java将zip文件上载到Lambda。

Using following link you can find out how to upload your Java based function to Lambda using Maven and CLI functionalities.

Following steps will help to You

  • Create a project directory
  • create build.gradle
  • Handle folder structure
  • build and package the project in a .zip file

http://docs.aws.amazon.com/lambda/latest/dg/create-deployment-pkg-zip-java.html

I understand the question is about uploading the zip file but it can help someone else. If you are using Eclipse then you can use the aws plugin to package code and then upload as lambda function to AWS Account .

Eclipse Plugin to Upload Java Lambda Function

Plugin will ask for the following information:

  1. credentials: which plugin can read from credentials file in .aws directory.
  2. role: name of role which will be assumed by lambda when executed.
  3. bucketName: where zip file will be stored.
  4. Other Settings such as Region, Memory etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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