Kousha
Kousha

Reputation: 36219

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.

Upvotes: 4

Views: 3072

Answers (4)

Zohaib
Zohaib

Reputation: 7116

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

Upvotes: 0

ChamalPradeep
ChamalPradeep

Reputation: 429

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

Upvotes: 0

James
James

Reputation: 11931

You can use the createFunction or updateFunctionCode methods of the AWSLambdaClient class to upload the zip file to Lambda using the AWS SDK for Java.

Upvotes: 5

Related Questions