Skip to main content

Lambda update function timeout

Lambda update function timeout causes timeout of a Lambda function to be updated to a specified value for a certain duration.

  • It checks the performance of the application (or service) running with a new timeout.
  • It also helps determine a safe overall timeout value for the function.

Lambda Update Function Timeout


View fault usage
Hitting a timeout is a very common and frequent scenario we find with lambda functions that can break the service and impacts their delivery. Such scenarios can still occur despite whatever availability aids AWS provides or we determine. Getting timeout errors interrupts the flow of the given function. So this category of chaos fault helps you to build the immunity of the application undergoing any such scenarios.


  • Kubernetes >= 1.17
  • Access to operate AWS Lambda service.
  • Kubernetes secret that has AWS access configuration(key) in the CHAOS_NAMESPACE. A secret file looks like this:
apiVersion: v1
kind: Secret
name: cloud-secret
type: Opaque
cloud_config.yml: |-
# Add the cloud AWS credentials respectively
aws_access_key_id = XXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXX
  • If you change the secret key name (from cloud_config.yml), update the AWS_SHARED_CREDENTIALS_FILE environment variable value on experiment.yaml with the same name.

Permissions required

Here is an example AWS policy to execute the fault.

View policy for the fault
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": [
"Resource": "*"

Refer to the superset permission/policy to execute all AWS faults.

Default validations

The Lambda function should be up and running.

Fault tunables

Fault tunables

Mandatory fields

Variables Description Notes
FUNCTION_NAME Function name of the target lambda function. It support single function name. For example, test-function
FUNCTION_TIMEOUT Provide the value of function timeout in seconds. The minimum value is 1s and maximum upto 15mins that is 900s
REGION The region name of the target lambda function For example, us-east-2

Optional fields

Variables Description Notes
TOTAL_CHAOS_DURATION The total time duration for chaos insertion in seconds Defaults to 30s
CHAOS_INTERVAL The interval (in seconds) between successive instance termination. Defaults to 30s
SEQUENCE It defines sequence of chaos execution for multiple instance Default value: parallel. Supported: serial, parallel
RAMP_TIME Period to wait before and after injection of chaos in seconds For example, 30

Fault examples

Common and AWS-specific tunables

Refer to the common attributes and AWS-specific tunables to tune the common tunables for all faults and aws specific tunables.

Timeout value

It can update the lambda function timeout value to a newer value by using FUNCTION_TIMEOUT environment variable as shown below.

Use the following example to tune this:

# contains the timeout value for the lambda function
kind: ChaosEngine
name: engine-nginx
engineState: "active"
chaosServiceAccount: litmus-admin
- name: lambda-update-function-timeout
# provide the function timeout for 10seconds
value: '10'
# provide the function name for timeout chaos
value: 'chaos-function'