aws_ lambda_ event_ source_ mapping cost estimation
An event source mapping is free. It connects a stream or queue to a Lambda function, and the cost is the invocations it drives plus any polling charges on the source.
An aws_
Every batch the mapping delivers is a Lambda invocation billed per request and per GB-second of duration. Batch settings are the main lever: a larger batch_
The polling side can add cost too. SQS polling by the mapping counts as SQS requests, and Kinesis or DynamoDB stream polling consumes read throughput on the source. High parallelization (parallelization_
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "aws_lambda_event_source_mapping" "queue" {
event_source_arn = aws_sqs_queue.jobs.arn
function_name = aws_lambda_function.worker.arn
batch_size = 10
scaling_config {
maximum_concurrency = 5
}
}Pricing dimensions
What you actually pay for when you provision aws_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Event source mapping | free | The mapping that connects the source to the function has no charge. $0 |
| Function invocations | per 1M requests + per GB-second | Each delivered batch invokes the function, billed per request and by duration. $0.20 per 1M requests |
| Source polling | per request / per shard-hour | SQS polling counts as SQS requests; stream polling consumes read throughput on Kinesis or DynamoDB. SQS: $0.40 per 1M requests |
Optimization tips
Common ways to reduce aws_ cost without changing the workload.
Increase batch_ size
Fewer invocations for the same throughputProcessing more records per invocation cuts the number of Lambda invocations for the same volume. A larger batch_
Add a batching window
Setting maximum_
Bound concurrency
Set maximum_
FAQ
Does a Lambda event source mapping cost money?
No. The mapping is free. You pay for the Lambda invocations it triggers, billed per request and per GB-second, plus the polling requests or stream read throughput it consumes on the source.
How do I reduce the cost of an event source mapping?
Raise batch_
Does polling an SQS queue with Lambda cost extra?
Yes, a little. The mapping polls the queue, and each poll counts as an SQS request. Larger batches and a batching window reduce polls, and the dominant cost remains the Lambda invocations themselves.
Related resources
More AWS resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_.