Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i create an java aws lambda function using the aws cli?

aws lambda create-function --function-name CliTestFun 
--runtime java8 --region ap-south-1 
--role arn:aws:iam::XXXXXXXXXXXX:role/aws-lambda-execution-role 
--handler com.example.demo.Search::handleRequest 

Parameter validation failed: Missing required parameter in input: "Code"

like image 727
Sainath Pabba Avatar asked Sep 17 '25 20:09

Sainath Pabba


1 Answers

You are not passing the code/zip to the lambda with --zip-file option.

--zip-file fileb://yourJavaCode.zip 

You can create the zip manually or using build tools like maven/gradle. Here is the link to learn more about packaging your java code for the lambda

Creating a ZIP Deployment Package for a Java Function

like image 151
Juned Ahsan Avatar answered Sep 20 '25 09:09

Juned Ahsan