I have a Lambda function that takes multiple arrays (~ 6) and returns all possible combinations.
When there are several hundred possible combinations, Lambda is successful. However, when there are several thousand possibilities, I get a rejection (answer below).
Please note that I am compressing / decompressing JSON in both directions to make the payload as small as possible.
I run this with maximum memory (1536) and a timeout of 20 seconds.
Any thoughts on what causes this?
{ "state": "rejected", "reason": { "name": "StatusCodeError", "statusCode": 504, "message": "504 - [object Object]", "error": { "message": "Endpoint request timed out" }, "options": { "uri": "https://blahblah/prod/getCombinations", "method": "POST", "timeout": 120000, "json": {... }, "simple": true, "resolveWithFullResponse": false }, "response": { "statusCode": 504, "body": { "message": "Endpoint request timed out" }, "headers": { "content-type": "application/json", "content-length": "41", "connection": "close", "date": "Thu, 20 Aug 2015 20:39:53 GMT", "x-amzn-requestid": "965d3b8d-477b-11e5-99d6-4102846d4b1e", "x-cache": "Error from cloudfront", "via": "1.1 b1103856e287e98f322630821d3c6e5b.cloudfront.net (CloudFront)", "x-amz-cf-id": "Dhk7ylTq6RDE74smC8uF8ajms8rpU0fp2dnexn4_I3qIXgvrrsg48w==" }, "request": { "uri": { "protocol": "https:", "slashes": true, "auth": null, "host": "blahblah", "port": 443, "hostname": "blahblah", "hash": null, "search": null, "query": null, "pathname": "/prod/getCombinations", "path": "/prod/getCombinations", "href": "https://blahblah" }, "method": "POST", "headers": { "accept": "application/json", "content-type": "application/json", "content-length": 10201 } } } } }