4
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"

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

Hi @Juned Ahsan your answer helped me to create a deployable zip file from the maven project, now I am able to create a function from CLI. I have 1 more question that 1)after creating the function every event is adding to that function like EC2,iot and so on... how can i ignore those? thanks Juned
@SainathPabba Glad to know that it helped you. I will encourage you to put another question on SO with your new problem so that you get better attention from all the users.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.