- Newest
- Most votes
- Most comments
Hi
Unfortunately, you can't directly force a Lambda function to return a 429 error upon throttling. Here's why, and potential solutions: Lambda Throttling Behavior: When a Lambda function is throttled, it usually triggers an internal error within the Lambda service, often resulting in a 5xx type error response. Lambda itself is not designed to emit a 429.
Alternative solutions/Workaround:
- Exponential Backoff and Retries: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
- Configuring provisioned concurrency - https://docs.aws.amazon.com/lambda/latest/dg/provisioned-concurrency.html
- Queuing - https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
Hi,
Is there an important reason why you use ALB instead of standard pattern API GTW + Lambda ?
If the case of this standard pattern with GTW, you will get a 429 on throttling. See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html for example
Best,
Didier
Hi,
The loadbalancer existed before the lambda and handles requests in a certain path. I want the lambda to handle a subpath of the same path the loadbalancer handles, so to avoid having the loadbalancer handling the request that I want to go to the lambda, I put the lambda as an action for a rule in the loadbalancer.
Best regards, Philip
Relevant content
- Accepted Answerasked 2 years ago
- asked 10 days ago
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
This isn't about API Gateway, this is about ALB -> Lambda.
@Max I just corrrected the answer thanks for the info