Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 310
ovunccetin Avatar asked Dec 23 '19 09:12

ovunccetin


1 Answers

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).

like image 190
Matus Dubrava Avatar answered Nov 15 '22 07:11

Matus Dubrava