Need to limit AWS API gateway incoming request body size to less than 800 KB

0

Hi, I am working on a requirement wherein I have to restrict the incoming requests to Lamba function behind the AWS API Gateway to be less than 800 KB. This needs to implemented preferrably at the Gateway level and need to implement it in Terraform as Infrastructure-as-Code. I am thinking that AWS WAF SizeConstraint might be the answer but looks like it will only inspect up to 4096 bytes and also not sure how to implement a filter that rejects incoming requests greater than 800 KB body size in Terraform.

Thanks in Advance

1 個回答
1
已接受的答案

The SizeConstraint operator is the right thing to use in this case - it looks at the value for the Content-Length header. The limitation on 8192 bytes is only in place if you want WAF to inspect the contents of the request.

profile pictureAWS
專家
已回答 1 年前

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

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

回答問題指南