Skip to main content

Lambda delete function concurrency

Introduction

Lambda delete function concurrency is an AWS fault that deletes the Lambda function's reserved concurrency, thereby ensuring that the function has adequate unreserved concurrency to run.

Lambda Delete Function Concurrency

Use cases

Lambda delete function concurrency examines the performance of the running Lambda application, if the Lambda function lacks sufficient concurrency.

note
  • Kubernetes version 1.17 or later is required to execute this fault.
  • Reserved concurrency must be set on the target Lambda function.
  • Lambda function must be up and running.
  • Kubernetes secret must have the AWS access configuration (key) in the CHAOS_NAMESPACE. Below is a sample secret file:
    apiVersion: v1
    kind: Secret
    metadata:
    name: cloud-secret
    type: Opaque
    stringData:
    cloud_config.yml: |-
    # Add the cloud AWS credentials respectively
    [default]
    aws_access_key_id = XXXXXXXXXXXXXXXXXXX
    aws_secret_access_key = XXXXXXXXXXXXXXX
  • Harness recommends using the same secret name, that is, cloud-secret. Otherwise, you must update the AWS_SHARED_CREDENTIALS_FILE environment variable in the fault template and you won't be able to use the default health check probes.
  • Go to AWS named profile for chaos to use a different profile for AWS faults.
  • Go to the superset permission/policy to execute all AWS faults.
  • Go to common tunables and AWS-specific tunables to tune the common tunables for all faults and AWS-specific tunables.

Below is an example AWS policy to execute the fault.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:UpdateFunctionConfiguration",
"lambda:GetFunctionConcurrency",
"lambda:GetFunction",
"lambda:DeleteFunctionConcurrency",
"lambda:PutFunctionConcurrency"
],
"Resource": "*"
}
]
}

Fault tunables

Mandatory tunables

Tunable Description Notes
FUNCTION_NAME Name of the target Lambda function. It supports a single function name. For example, test-function.
FUNCTION_VERSION Specifies the version of the function. Default: $LATEST.
REGION Region name of the target Lambda function. For example, us-east-2.

Optional tunables

Tunable Description Notes
TOTAL_CHAOS_DURATION Duration that you specify, through which chaos is injected into the target resource (in seconds). Default: 30 s
CHAOS_INTERVAL Time interval between two successive deletions of reserved concurrency (in seconds). Default: 30 s
RAMP_TIME Period to wait before and after injecting chaos (in seconds). For example, 30 s.