Cloudfront showing limit error

0

I have my landing page deployed via Amplify. On the sitemap xml the sitemap is not getting accessed as the limit is exceeded for response length (not sure).

ERROR 502 The Lambda function result failed validation: The body is not a string, is not an object, or exceeds the maximum size. See Limits in the Amazon CloudFront Developer Guide. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

RESPONSE DATA in network tab content-length: 1074 content-type: text/html

I guess the max permissible length is 1024 bytes. Can someone correct me if I am guessing wrong. Also, can someone point me to articles if and how I can increase the limit to maybe 4096.

1 個回答
0

From the error, it appears you're using a Lambda@Edge function, but you haven't mentioned what it's doing, or what trigger it's on. If you're using Lambda@Edge to generate a response, the size is limited to 40KB (for Viewer triggers) or 1MB (for Origin triggers) - see documentation here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html#limits-lambda-at-edge

Does the function behave as expected when testing it? Do you have logging enabled for the function, and does that yield any information as to what the problem might be?

AWS
專家
Paul_L
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南