- Newest
- Most votes
- Most comments
When you're encountering an "Access denied" error with "UnknownError" while trying to create a Lambda function, there are several potential causes and solutions to consider:
-
Check if your AWS account is managed by Organizations - there might be Service Control Policies (SCPs) in place that are restricting Lambda operations, even if you have the appropriate IAM policies.
-
Verify you're in the correct AWS region where you intend to create the Lambda function, as Lambda functions are region-specific.
-
Check the AWS Service Health Dashboard to see if there are any ongoing issues with Lambda or IAM services in your region. Sometimes temporary service disruptions can cause these errors.
-
If you're using a browser, try accessing Lambda from a different browser, in incognito mode, or from a different device to rule out any local issues.
-
If you're using the root user and still experiencing this issue, there might be a problem with your AWS account itself. In this case, the recommended solution is to contact AWS Support by opening a support case under the "Account and billing" category, which can be done free of charge.
-
For IAM users, ensure the trust relationship for your Lambda execution role is properly configured to allow Lambda to assume the role.
If the issue persists after checking these items, contacting AWS Support would be the best course of action as they can investigate account-specific issues that might be causing this problem.
Sources
Access denied in creating lambda function | AWS re:Post
My Lambda shows Access denied | AWS re:Post
Access Denied Error when I visit Lambda dashboard ans not able to create Function | AWS re:Post
Failed to create Lambda function simply withe the error message "The role defined for the function cannot be assumed by Lambda" | AWS re:Post
answered a year ago

What permissions does the IAM principial you are logged in as have?