AWS Lambda function is not configured for function-level concurrent execution Limit

Description

Adding concurrency to Lambda initializes that number of execution environments for multiple parallel requests at low latency. However, this could spike costs and open the door for abuse. Adding concurrency limits can prevent a rapid spike in usage and costs, while also increasing or lowering the default concurrency limit.

Fix - Buildtime

Terraform
  • Resource: aws_lambda_function
  • Argument: reserved_concurrent_executions

resource “aws_lambda_function” “example” {

+ reserved_concurrent_executions = 100

}

CloudFormation

  • Resources: AWS::Lambda::Function, AWS::Serverless::Function
  • Argument: Properties/ReservedConcurrentExecutions

Type: AWS::Lambda::Function

Properties:

ReservedConcurrentExecutions: 100

ReLambda