I am new to AWS Lambda service. So I tried to create a simple lambda function from using the blue-print of 'hello-world'. I am getting a 403 error when I am trying to create the function. Can someone please help me out?
-
What permissions do you have? What does the network tab say? What request fails with what response exactly?luk2302– luk23022021-09-14 07:51:07 +00:00Commented Sep 14, 2021 at 7:51
-
It seems you have permissions issue. Please check with your administrator about the roles needed to create Lambda.Muhammad Jahanzeb– Muhammad Jahanzeb2021-09-14 07:52:19 +00:00Commented Sep 14, 2021 at 7:52
-
@luk2302 I am myself the administrator. This is first time I am creating a lambda function and getting 403 and I am creating a new role for it. In network tab POST is giving 403.ameesha gupta– ameesha gupta2021-09-14 08:17:18 +00:00Commented Sep 14, 2021 at 8:17
-
As others said you don’t have permission to create the lambda. Grant yourself the poor private permissionsChris Maggiulli– Chris Maggiulli2021-09-14 12:23:08 +00:00Commented Sep 14, 2021 at 12:23
2 Answers
When working with Lambda functions, you need to create an IAM role that has the appropriate permissions. Assume that you want to create an AWS Lambda function that invokes several AWS Services, like Amazon DynamoDB. You need to create an IAM role that has permissions to invoke a service that the Lambda function will invoke.
Because you are new to working with Lambda functions, you can refer to the following AWS tutorials. If you follow these, you will successfully deploy a Lambda function.
The 1st link shows you how to create a Lambda function that is able to detect personal protective equipment (PPE) in images located in an Amazon Simple Storage Service (Amazon S3) bucket. This example demonstrates how to create a Lambda function using the Java run-time API that invokes these services:
- Amazon S3 service
- Amazon Rekognition service
- Amazon DynamoDB service
- Amazon Simple Email service
Creating an AWS Lambda function that detects images with Personal Protective Equipment
It shows you how to successfully develop and deploy the Lambda function Likewise, here is a tutorial that shows you how to create a Lambda function using the AWS SDK for JavaScript.
Today, I encountered the same error "Request failed with status code 403" that only occurred with the Python runtime (Python3.8, Python3.9), not with any other runtime. Interestingly, there were no relevant log entries in CloudTrail. However, I was able to create a Lambda function with a Python runtime successfully using the AWS CLI. Keen to know if it is a bug on AWS console or some other reasons.
