Skip to main content
added 153 characters in body
Source Link

We can't reduce the concurrency to 1, but there is a way we can restrict the maximum concurrency to 2 and make sure lambda won't scale more than that.

To limit the number of concurrent invocations of an AWS Lambda function, you can use the maximum concurrency feature for Lambda event source mappings. This is an attribute of the event source mapping, which polls messages from Amazon SQS and pushes them to the Lambda function.

Configuring maximum concurrency through console

This feature was introduced by AWS in 2023, and you can read more about it in the official announcement.

In Terraform, you can implement this feature using the aws_lambda_event_source_mapping resource with the scale_config attribute.

It's important to note that this feature is only available when using Lambda with SQS—it does not work independently or with other AWS services. Additionally, the minimum value you can set for this attribute is 2, so you cannot limit Lambda to a single concurrent execution.

To limit the number of concurrent invocations of an AWS Lambda function, you can use the maximum concurrency feature for Lambda event source mappings. This is an attribute of the event source mapping, which polls messages from Amazon SQS and pushes them to the Lambda function.

Configuring maximum concurrency through console

This feature was introduced by AWS in 2023, and you can read more about it in the official announcement.

In Terraform, you can implement this feature using the aws_lambda_event_source_mapping resource with the scale_config attribute.

It's important to note that this feature is only available when using Lambda with SQS—it does not work independently or with other AWS services. Additionally, the minimum value you can set for this attribute is 2, so you cannot limit Lambda to a single concurrent execution.

We can't reduce the concurrency to 1, but there is a way we can restrict the maximum concurrency to 2 and make sure lambda won't scale more than that.

To limit the number of concurrent invocations of an AWS Lambda function, you can use the maximum concurrency feature for Lambda event source mappings. This is an attribute of the event source mapping, which polls messages from Amazon SQS and pushes them to the Lambda function.

Configuring maximum concurrency through console

This feature was introduced by AWS in 2023, and you can read more about it in the official announcement.

In Terraform, you can implement this feature using the aws_lambda_event_source_mapping resource with the scale_config attribute.

It's important to note that this feature is only available when using Lambda with SQS—it does not work independently or with other AWS services. Additionally, the minimum value you can set for this attribute is 2, so you cannot limit Lambda to a single concurrent execution.

Source Link

To limit the number of concurrent invocations of an AWS Lambda function, you can use the maximum concurrency feature for Lambda event source mappings. This is an attribute of the event source mapping, which polls messages from Amazon SQS and pushes them to the Lambda function.

Configuring maximum concurrency through console

This feature was introduced by AWS in 2023, and you can read more about it in the official announcement.

In Terraform, you can implement this feature using the aws_lambda_event_source_mapping resource with the scale_config attribute.

It's important to note that this feature is only available when using Lambda with SQS—it does not work independently or with other AWS services. Additionally, the minimum value you can set for this attribute is 2, so you cannot limit Lambda to a single concurrent execution.