Skip to main content

AWS Lambda Function Status Check

This probe checks if a Lambda function exists and is in the 'Active' state.

Infrastructure type

  • Kubernetes

Use cases

AWS Lambda Function Status Check probe helps you:

  • Verify Lambda functions remain active during chaos experiments
  • Validate function availability after configuration changes
  • Monitor serverless application health and readiness
  • Ensure functions are deployable and invocable

Overview

This probe uses the AWS CLI to query Lambda function status and validates that the function is in the 'Active' state. It's particularly useful for serverless architectures where function availability is critical.

Probe type

Command Probe

Prerequisites

  • Kubernetes cluster with chaos infrastructure installed
  • AWS credentials configured with appropriate IAM permissions:
    • lambda:GetFunction
    • lambda:GetFunctionConfiguration
  • Network connectivity to AWS API endpoints
  • Target Lambda function should exist in the specified region

Probe properties

Command

healthchecks -name lambda-update-function

Comparator

TypeCriteriaValue
stringcontains[Pass]

The probe passes when the command output contains [Pass], indicating the Lambda function is in the 'Active' state.

Environment variables

VariableDescriptionRequiredDefault
FUNCTION_NAMEName of the Lambda function to check (e.g., my-lambda-function).Yes-
REGIONAWS region where the Lambda function is located (e.g., us-east-1).Yes-

Run properties

PropertyDescriptionTypeDefault
timeoutMaximum time to wait for the probe to complete (e.g., 30s, 1m, 5m)String300s
intervalTime between probe executions (e.g., 5s, 30s, 1m)String10s
attemptNumber of retry attempts before marking the probe as failedInteger1
pollingIntervalTime between retry attempts (e.g., 1s, 5s, 10s)String-
initialDelayInitial delay before starting the probe (e.g., 0s, 10s, 30s)String-
stopOnFailureStop the experiment if the probe failsBooleanfalse
verbosityLog verbosity level (info, debug, trace)String-

Probe definition

You can define this probe in your chaos experiment as follows:

probe:
- name: "lambda-function-health-check"
type: "cmdProbe"
mode: "Edge"
cmdProbe/inputs:
command: "healthchecks -name lambda-update-function"
comparator:
type: "string"
criteria: "contains"
value: "[Pass]"
env:
- name: FUNCTION_NAME
value: "my-lambda-function"
- name: REGION
value: "us-east-1"
runProperties:
timeout: 300s
interval: 10s
attempt: 1
stopOnFailure: false