ovunccetin
ovunccetin

Reputation: 8663

Does AWS charge polling time of a Lambda function triggered by SQS?

AWS allows a Lambda function to be triggered by an SQS queue. With respect to the documentation, Lambda polls the queue and invokes the function synchronously with a batch of messages.

AWS takes the execution time into account while charging for a Lambda function. Does the polling time counted as the execution time and be charged? Or is it free?

Upvotes: 11

Views: 6182

Answers (1)

Matus Dubrava
Matus Dubrava

Reputation: 14462

It is not counted as the lambda execution time but it is not free either.

When there is no data to be pulled from your SQS queue, your lambda function is not executed, therefore there is no cost associated with lambda execution time.

But when lambda service polls SQS queue, it is a normal SQS API request and it is charged based on the SQS pricing. No matter how the SQS API request is made, whether manually via CLI, programatically via SDK or automatically via lambda service, it will be charged.

For example, you pay $0.0000004 per SQS API request (Standard queue) in US East region (or $0.40 per one million requests) and $0.0000005 per request (FIFO queue).

Upvotes: 25

Related Questions