Select Language:
If you’re running into an AccessDeniedException when trying to update your Lambda function using the AWS CLI, even though you believe your permissions are correct, don’t worry — you’re not alone. Here’s a straightforward step-by-step guide to help you troubleshoot and resolve this issue.
First, review the permissions assigned to your user. Even if you have policies like AWSLambda_FullAccess, AWSLambdaFullAccess, or PowerUserAccess, it’s essential to verify that these policies are attached correctly and contain the right permissions. Confirm that no policies are explicitly denying access.
Next, use the IAM Policy Simulator to check if your permissions should allow the update. Often, the simulator will show that the update action is “allowed,” yet in practice, calls still fail. This discrepancy could be due to other factors outside your direct permissions.
Make sure your user doesn’t have permission boundaries set. Permission boundaries can restrict what your policies allow, even if they appear permissive. You can verify this by checking your user details; if no boundary is set, then this isn’t the cause.
Look into group policies. Check for any deny statements or inline policies attached to your groups, such as DelocoBasicGroup or AWSrekognition. Often, all policies may only contain “Allow” statements, but it’s good to double-check.
Review any Service Control Policies (SCPs) if you’re part of an organization that uses AWS Organizations. These policies can restrict actions across multiple accounts. As of now, make sure there are no SCPs blocking Lambda updates.
Inspect your Lambda function’s resource policy. Ensure it isn’t explicitly denying access to your user or account. The resource policy should permit your operations and avoid cross-account restrictions unless intentionally configured.
Try updating your Lambda in different ways. For example, use the S3 method with aws lambda update-function-code --s3-bucket --s3-key or upload a zip file with aws lambda update-function-code --zip-file fileb://test.zip. If both methods fail with the same access error, it indicates the problem is not related to the method you use.
Create a new test user with exactly the same policies and permissions. Have this new user attempt to update the Lambda. If they also experience the same error, then the issue is likely account-wide and not specific to your user.
Notice that read operations, such as aws lambda get-function and aws lambda list-functions, work perfectly. This suggests the problem is isolated to write or update permissions.
An important point to consider: even if the IAM Policy Simulator shows that your actions should be allowed, the actual API calls might still fail. This indicates a possible hidden restriction outside the explicit policies.
Given that this issue started suddenly after working fine for a while, it could be caused by recent account changes or some configuration updates. If nothing in your permissions setup appears wrong, consider contacting AWS Support for a deeper investigation, as the problem might be on their end, especially if multiple users are affected.
By thoroughly checking your policies, permissions, and settings, and testing with fresh users and different update methods, you can identify where the restriction is coming from and get your Lambda functions updating again.



