A Lambda function behind an ALB needs to call a downstream HTTP service but must honor client-supplied timeouts and cap total request time. Which configuration best ensures the Lambda doesn’t exceed the ALB/Lambda integration limit and that timeouts behave predictably?
Answer
Set Lambda timeout slightly less than the ALB/lambda integration limit and set HTTP client timeout to be lower than the remaining execution time
Explanation
Aligning Lambda timeout and downstream HTTP timeout prevents truncated responses and avoids the function being killed mid-request. A client can request timeouts that are then bounded by server-side execution limits.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
You’re implementing an idempotent “create order” endpoint via API Gateway → Lambda → DynamoDB. The client may retry on network timeouts. Which approach most reliably enforces idempotency under concurrent requests?
View question →
A system ingests user events to an S3 bucket and triggers processing via S3 notifications to a Lambda function. The processor must ensure it processes each logical event once even if the notification is delivered multiple times. Which strategy is best?
View question →
In a serverless API using API Gateway + Lambda with a DynamoDB-backed data layer, which change best prevents accidental exposure of other tenants’ records when the tenant ID is supplied by the client?
View question →
A Lambda function processes SQS messages in batches and updates DynamoDB. To ensure “at-least-once” processing doesn’t create duplicates or inconsistent state, which design is most robust?
View question →
You are designing a REST API with API Gateway and Lambda and need to minimize cold-start impact while supporting versioned deployments. Which combination is most effective?
View question →
In an AWS Lambda deployment that uses API Gateway, you need to guarantee that environment variables are treated as secrets rather than plain configuration. Which approach is best?
View question →