AWS Lambda function-level ReservedConcurrentExecutions limit is not set Affecting Lambda service in AWS


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Availability/ Limits

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
  • Snyk IDSNYK-CC-00745
  • creditSnyk Research Team

Description

Ensure that the function can scale without impacting other resources and maintain predictable performance and cost by defining a specific number of reserved concurrent executions. Omitting or disabling ReservedConcurrentExecutions for AWS Lambda functions can lead to uncontrolled scaling, which may result in throttling, increased latency, or higher costs due to excessive executions.

How to fix?

Set the reserved_concurrent_executions attribute in the aws_lambda_function resource to a positive of at least 1.

Example Configuration

resource "aws_lambda_function" "allowed1_lambda" {
  filename      = "lambda_function_payload.zip"
  function_name = "lambda_function_allowed745"
  role          = aws_iam_role.iam_for_lambda.arn
  handler       = "index.test"

  source_code_hash = data.archive_file.allowed1_file.output_base64sha256

  runtime                        = "nodejs18.x"
  reserved_concurrent_executions = 200
}