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 réponse
1
Réponse acceptée

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
EXPERT
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions