| Settings | Limits |
| Description |
Settings | Limits | Explained |
Can be increased |
|
Writable Path & Space
|
/tmp/ 512 MB |
-- |
| Default Memory & Execution Time |
128 MB Memory 3 Second Timeout |
-- |
| Max Memory & Execution Time |
10,240 MB (1 MB increments) 900 seconds (15 Minutes) Timeout |
-- |
| Number of processes and threads (Total) |
1024 |
-- |
| Number of File descriptors (Total) |
1024 |
-- |
| Maximum deployment package size |
50 MB (zipped, direct upload)
250 MB (unzipped, including layers)
|
-- |
| Container image code package size |
10 GB
|
-- |
| Maximum deployment package size for console editor |
3 MB |
-- |
| Total size of deployment package per region |
75 GB |
Can be increased upto Terabytes |
| Maximum size of environment variables set |
4 KB |
-- |
| Maximum function Layers |
5 layers |
-- |
| Environment variables size |
4 KB |
-- |
| Maximum test events (Console editor) |
10 |
-- |
| Invocation payload Limit (request and response) |
6 MB (synchronous) 256 KB (asynchronous) |
-- |
| Elastic network interpaces per VPC |
250 |
Can be increased upto Hundreds |
| Lambda Destinations |
- It sends invocation records to a destination (SQS queue, SNS topic, Lambda function, or EventBridge event bus) when the lambda function is invoked asynchronously
- It also supports stream invocation
|
Can be increased upto Hundreds |
| Monitoring tools |
- (Default) CloudWatch Logs stream
- AWS X-Ray
- CloudWatch Lambda Insights (preview)
|
-- |
| VPC |
- When you enable VPC, your Lambda function will lose default internet access
- If you require external internet access for your function, ensure that your security group allows outbound connections and that your VPC has a NAT gateway
|
-- |
| Concurrency |
- Concurrent Execution refers to the execution of number of function at a given time. By default the limit is 1000 across all function within a given region
- AWS Lambda keeps 100 for the unreserved function
- So, if there are 1000 then you can select from 900 and reserve concurrency for selected function and rest 100 is used for the unreserved function
| Can be increased upto Hundreds of thousands |
| DLQ (Dead Letter Queue) |
- Failed Lambda is invoked twice by default and the event is discarded
- DLQ instruct lamnda to send unprocessed events to AWS SQS or AWS SNS
- DLQ helps you troubleshoot and examine the unprocessed request
| -- |
| Throttle |
- Throttle will set reserved concurrency of the function to zero and it will throttle all future invocation
- If the function is throttled then it will fail to run
- If the fucntion is ran from Lambda console then it will throw "Calling the Invoke API failed with message: Rate Exceeded."
| -- |
| File system |
- File system will allow you to add Amazon EFS file system, which provides distributed network storage for the instances of the function
- To connect to the file system, you need to connect your lambda function to VPC
| -- |
| State machines |
- Step Functions state machines which orchestrate this function
- The Step Functions state machines page lists all state machines in the current AWS region with at least one workflow step that invokes a Lambda function
| -- |
| Database proxies |
- Database proxy manages a pool of database connections and relays queries from a function
- It uses Secrets Manager secret to access credentials for a database
- To connect to the file system, you need to connect your lambda function to VPC
| -- |
| Execution Role (Common Execution Role Available) |
| AWSLambdaBasicExecutionRole |
Grants permissions only for the Amazon CloudWatch Logs actions to write logs. |
| AWSLambdaKinesisExecutionRole |
Grants permissions for Amazon Kinesis Streams actions, and CloudWatch Logs actions. |
| AWSLambdaDynamoDBExecutionRole |
Grants permissions for DynamoDB streams actions and CloudWatch Logs actions. |
| AWSLambdaVPCAccessExecutionRole |
Grants permissions for Amazon Elastic Compute Cloud (Amazon EC2) actions to manage elastic network interfaces (ENIs). |
| AWSXrayWriteOnlyAccess |
Grants permission for X-ray to to upload trace data to debug and analyze. |
| Triggers |
Description |
Requirement |
| API Gateway |
Trigger AWS Lambda function over HTTPS |
API Endpoint name API Endpoint Deployment Stage Security Role |
| AWS IoT |
Trigger AWS Lambda for performing specific action by mapping your AWS IoT Dash Button (Cloud Programmable Dash Button) |
DSN (Device Serial Number) |
| Alexa Skill Kit |
Trigger AWS Lambda to build services that give new skills to Alexa |
-- |
| Alexa Smart Home |
Trigger AWS Lambda with desired skill |
Application ID (Skill) |
| Application Load Balancer |
Trigger AWS Lambda from ALB |
Application Load Balancer Listener (It is the port that ALP receivce traffice) Host Path |
| CloudFront |
Trigger AWS Lambda based on difference CloudFront event. |
CloudFront distribution, Cache behaviour, CloudFront event (Origin request/response, Viewer request/response). To set CloudFront trigger, one need to publish the version of Lambda. Limitations: Runtime is limited to Node.js 6.10 /tmp/ space is not available Environment variables, DLQ & Amazon VPC's cannot be used |
| CloudWatch Events |
Trigger AWS Lambda on desired time interval (rate(1 day)) or on the state change of EC2, RDS, S3, Health. |
Rule based on either Event Pattern (time interval) Schedule Expression (Auto Scaling on events like Instance launch and terminate AWS API call via CloudTrail |
| CloudWatch Logs |
Trigger AWS Lambda based on the CloudWatch Logs |
Log Group Name |
| Code Commit |
Trigger AWS Lambda based on the AWS CodeCommit version control system |
Repository Name Event Type |
| Cognito Sync Trigger |
Trigger AWS Lambda in response to event, each time the dataset is synchronized |
Cognito Identity Pool dataset |
| DynamoDB |
Trigger AWS Lambda whenever the DynomoDB table is updated |
DynamoDB Table name Batch Size(The largest number of records that AWS Lambda will retrieve from your table at the time of invoking your function. Your function receives an event with all the retrieved records) |
| Kinesis |
Trigger AWS Lambda whenever the Kinesis stream is updated |
Kinesis Stream Batch Size |
| S3 |
Trigger AWS Lambda in response to file dropped in S3 bucket |
Bucket Name Event Type (Object Removed, Object Created) |
| SNS |
Trigger AWS Lambda whenever the message is published to Amazon SNS Topic |
SNS Topic |
| SQS |
Trigger AWS Lambda on message arrival in SQS |
SQS queue Batch size Limitation: It only works with Standard queue and not FIFO queue |
| Troubleshooting |
| Error |
Possible Reason |
Solution |
File "/var/task/lambda_function.py", line 2, in lambda_handler return event['demoevent']
KeyError: 'demoevent'
|
Event does not have the key 'demoevent' or either misspelled
|
Make sure the event is getting the desired key if it is receiving the event from any trigger. Or if the not outside event is passed than check for misspell. Or check the event list by printing event.
|
| botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetParameters operation: User: arn:aws:dummy::1234:assumed-role/role/ is not authorized to perform: ssm:GetParameters on resource: arn:aws:ssm:dummy |
Lacks Permission to access |
Assign appropriate permission for accessibility |
| ImportError: Missing required dependencies [‘module'] |
Dependent module is missing |
Install/Upload the required module |
| sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "host.dummy.region.rds.amazonaws.com" to address: Name or service not known |
RDS Host is unavailable |
Make sure the RDS instance is up and running. Double check the RDS hostname |
| [Errno 32] Broken pipe |
Connection is lost (Either from your side or may be some problem from AWS) While invoking another Lambda, if the payload size exceed the mentioned limit |
Make sure if you are passing the payload of right size. Check for the connection. |
| Unable to import module ‘lambda_function/index’ No module named ‘lambda_function' |
Handler configuration is not matching the main file name |
Update the handler configuration as per your filename.function_name |