When accessing our static webpage hosted on an ALB served by a Lambda, we get a 502 bad gateway error. In the ALB logs, we can see that the error is that our Lambda response is larger than 1MB. We want to continue using an Application Load Balancer for our webpage, and need to find some way around this 1MB limit (can we deploy our code such that the Lambda returns multiple separate <1MB chunks of JS code?)
We looked online at other SO questions, and have found only a couple with people running into our issue, but no solutions provided. The AWS docs document this limitation, but again, no solutions are provided.
We ended up deciding to switch off of the ALB and move to API Gateway. API Gateway can handle a 6MB return from a Lambda, so this should be fine for our purposes.