0

aws lambda create-function --function-name CliTestFun --runtime java8 --region ap-south-1 --role arn:aws:iam::XXXXXXXXXXXXX:role/aws-lambda-basic-execution-role --handler com.example.demo.Search::handleRequest --zip fileb:///home/workspace/example/target/testfunction-1.0.0.jar

from the above command, I am able to create the function but the problem is after I run this command I checked it in aws console, So there are so many unnecessary resources like iot,ec2,s3... added to it but I wanted to add specific resources only required to that lambda ,how can I ignore those resources when I try to create it from aws CLI.

Is it any configuration related problem or something?

1 Answer 1

0

It should be because the IAM role you are attaching to the lambda function has access to the resources you are seeing the AWS console.

You may check if the below IAM role you are attaching to the lambda function has access to the resources you are seeing in the console

aws-lambda-basic-execution-role
Sign up to request clarification or add additional context in comments.

1 Comment

Hi, @karthikeayan your answer is really helped me, I am able to do that now. thanks, thanks karthikeayan. for adding API-gateway to the lambda also the same thing happens?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.