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 Risposta
1
Risposta accettata

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
ESPERTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande