Using CloudTrail LookupEvents to Identify the Source of Lambda Rate Exceeded Errors

Use AWS CloudTrail LookupEvents to identify which IAM identity or service is triggering 'Rate exceeded' throttling errors on Lambda management API calls.

You might receive a 'Rate exceeded' error when your environment exceeds Lambda function quota limits for API requests. Before you can resolve a 'Rate exceeded' error, review your CloudTrail event logs using the following commands

View the total count of management event API calls

Run the CloudTrail lookup-events AWS CLI command. Set the start-time, the end-time, and the time zone for each value to match the problematic timeframe.

aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventSource,AttributeValue=lambda.amazonaws.com --start-time YYYY-MM-DDTHH:MM:SS+00:00 --end-time YYYY-MM-DDTHH:MM:SS+00:00 | grep -i EventName | grep -v CloudTrailEvent | sort | uniq -c | sort -r
                                


View the total count of API calls made by each user

Run the CloudTrail lookup-events command. Set the start-time, the end-time, and the time zone for each value to match the problematic timeframe.

aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventSource,AttributeValue=lambda.amazonaws.com --start-time YYYY-MM-DDTHH:MM:SS+00:00 --end-time YYYY-MM-DDTHH:MM:SS+00:00 | grep -i Username | grep -v CloudTrailEvent | sort | uniq -c | sort -r
                                


Created by: