Home > Software design >  Can we import our locally created lambda function to AWS console?
Can we import our locally created lambda function to AWS console?

Time:01-15

I have been working on AWS Lambda. For some reason, I had to create a Lambda function locally. I just want to know, can we import local lambda function to aws lambda console. If yes then please elaborate how can i achieve this?

CodePudding user response:

It is pretty easy:

  1. Write your lambda function with a lambda_handler
  2. Create a requirements.txt
  3. Install all the requirements in the same folder
  4. Package it(Zip file).
  5. Go to AWS Lambda --> Create function --> Fill all details --> Create function.
  6. Under code section: upload from --> .zip file ---> (select your file) --> upload--> save
  7. Modify the handler according to your function name.

CodePudding user response:

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. You can deploy the Lambda function (the JAR) using the AWS Management Console, as described in this AWS tutorial.

Creating an AWS Lambda function that detects images with Personal Protective Equipment

  •  Tags:  
  • Related