AWS Lambda Edge Limits
Quotas
Quotas included in this section are applied to Lambda@Edge. They are in addition to the CloudFront and Lambda quotas that come by default and are also applied.
Important
Lambda will scale capacity in a dynamic manner as a response to increased traffic, found in the quotas of your account.
Also, you need to remain aware of the fact that there exists more restrictions while using Lambda@Edge functions.
Quotas that differ by event type
Entity | Origin request and response event quotas | Viewer request and response event quotas |
---|---|---|
Function memory size | Same as Lambda quotas | 128 MB |
Function timeout. The function can make network calls to resources such as Amazon S3 buckets, DynamoDB tables, or Amazon EC2 instances in AWS Regions. | 30 seconds | 5 seconds |
Size of a response that is generated by a Lambda function, including headers and body | 1 MB | 40 KB |
Maximum compressed size of a Lambda function and any included libraries | 50 MB | 1 MB |
Other Quotas
Entity | Default quota |
---|---|
Distributions per AWS account that you can create triggers for | 25 Request a higher quota |
Triggers per distribution | 100 Request a higher quota |
Requests per second | 10,000 (in each Region) Request a higher quota |
Concurrent executions | 1000 (in each Region) |
URI and Query String Size Quotas
Upon the access or update of a URI or query string in a Lambda@Edge function, there has to be a total length of URI along with the query string of a size less than 8,192 characters.
Request Body with the Include Body Option Size Quotas
Upon choosing the Include Body option for the sake of exposing the request body to the Lambda@Edge function, the below size quotas are applied to the parts of the body which have been exposed or replaced.
Important
Body: base64 encoded at all times through Lambda@Edge prior to being exposed.
Size Quotas:
Exposing the Body to a Lambda Function
In case of having a large request body, Lambda@Edge will truncate itprior to getting it exposed, just like this:
- Viewer requests: body gets truncated at 40 KB.
- Origin requests: body gets truncated at 1 MB.
Returning a Request Body from a Lambda Function
The below body size quotas get applied upon returning the request body from a Lambda function:
Type of body encoding | Allowed body size: Viewer request | Allowed body size: Origin request |
text | 40 KB | 1 MB |
base64 | 53.2 KB | 1.33 MB |
Triggers for Microsoft Smooth Streaming
No triggers may be created for a CloudFront distribution which is being used for video on-demand streaming of media files that have been transcoded into a Microsoft Smooth Streaming format.
Triggers for Network Access
Functions which are being triggered by origin request and response events + functions getting triggered by viewer request and response events are capable of performing network calls to resources that are found on the internet + AWS services like S3 buckets, EC2 instances or DynamoDB tables.
URI
In case the URI for a request gets changed by a function, this will not affect the cache behavior for this request or the origin to which the request gets forwarded to.
URI + Query String Encoding
URI and query string must be UTF-8 encoded for a Lambda function to accept them. The below affect the behavior of CloudFront and Lambda:
- Encoding of the URI + query string which was received by CloudFront in the request that comes from the viewer
- URI or query string either altered by a function that has been triggered by a specific viewer request or an origin request event
Values Are UTF-8 Encoded
The values get forwarded to the Lambda function by CloudFront without getting altered.
Values Are ISO 8859-1 Encoded
ISO 8859-1 character encoding gets converted by CloudFront to UTF-8 prior to getting the values forwarded straight to the Lambda function.
Values Are Encoded Through Other Character Encoding
In case the values get encoded through some different character encoding, CloudFront will believe they are ISO 8859-1 encoded and will thus try to convert from an ISO 8859-1 encoding to a UTF-8 encoding.
What value CloudFront will forward to your origin server will depend on the case if functions being triggered by viewer request or origin request events alter URI or query string:
- In case the URI or query string is not changed by functions: CloudFront will begin forwarding the values received by CloudFront through the request coming from the viewer to the origin server directly.
- In case the URI or query stringare changed by the functions: CloudFront will be forwarding the UTF-8 encoded value.
Both cases have behavior that does not get affected by character encoding of a request coming from the viewer.
See Also