AWS Lambda
Developer Guide

Lambda Execution Environment and Available Libraries

The underlying AWS Lambda execution environment includes the following software and libraries.

  • Operating system – Amazon Linux

  • AMI – amzn-ami-hvm-2017.03.1.20170812-x86_64-gp2

  • Linux kernel – 4.14.62-84.118.amzn2.x86_64

  • AWS SDK for JavaScript – 2.290.0

  • SDK for Python (Boto 3) – 3-1.7.74 botocore-1.10.74

The execution environment uses NTP to synchronize the system clock. If you're using any native binaries in your code, make sure that they're compiled against the package and library versions from this AMI and kernel. Only 64-bit binaries are supported, and that the specific CPU make and model is subject to change.

AWS Lambda supports the following runtimes.

  • Node.js – Node.js 6.10, Node.js 8.10

  • Java – Java 8 (java-1.8.0-openjdk)

  • Python – Python 2.7, Python 3.6

  • C# – .NET Core 1.0.1, .NET Core 2.0, and .NET Core 2.1

  • PowerShell – .NET Core 2.1

  • Go – Go 1.x

Not all runtime languages are available on the public Amazon Linux AMI version or its yum repositories. You might need to download and install them manually from their respective public sites.

Environment Variables Available to Lambda Functions

The following is a list of environment variables that are part of the AWS Lambda execution environment and made available to Lambda functions. The table below indicates which ones are reserved by AWS Lambda and can't be changed, as well as which ones you can set when creating your Lambda function. For more information on using environment variables with your Lambda function, see Environment Variables.

Lambda Environment Variables

Key Reserved Value
LAMBDA_TASK_ROOT Yes Contains the path to your Lambda function code.
AWS_EXECUTION_ENV Yes The environment variable is set to one of the following options, depending on the runtime of the Lambda function:
  • AWS_Lambda_java8

  • AWS_Lambda_nodejs4.3

  • AWS_Lambda_nodejs6.10

  • AWS_Lambda_nodejs8.10

  • AWS_Lambda_python2.7

  • AWS_Lambda_python3.6

  • AWS_Lambda_dotnetcore1.0

  • AWS_Lambda_dotnetcore2.0

  • AWS_Lambda_dotnetcore2.1

LAMBDA_RUNTIME_DIR Yes Restricted to Lambda runtime-related artifacts. For example, the aws-sdk for Node.js and boto3 for Python can be found under this path.
AWS_REGION Yes The AWS Region where the Lambda function is executed.
AWS_DEFAULT_REGION Yes The AWS Region where the Lambda function is executed.
AWS_LAMBDA_LOG_GROUP_NAME Yes The name of Amazon CloudWatch Logs group where log streams that contain your Lambda function logs are created.
AWS_LAMBDA_LOG_STREAM_NAME Yes The Amazon CloudWatch Logs streams that contain your Lambda function logs.
AWS_LAMBDA_FUNCTION_NAME Yes The name of the Lambda function.
AWS_LAMBDA_FUNCTION_MEMORY_SIZE Yes The size of the Lambda function in MB.
AWS_LAMBDA_FUNCTION_VERSION Yes The version of the Lambda function.

AWS_ACCESS_KEY

AWS_ACCESS_KEY_ID

AWS_SECRET_KEY

AWS_SECRET_ACCESS_KEY

AWS_SESSION_TOKEN

AWS_SECURITY_TOKEN

Yes The security credentials that are required to execute the Lambda function, depending on which runtime is used. Different runtimes use a subset of these keys. They are generated via an IAM execution role that's specified for the function.
PATH No Contains /usr/local/bin, /usr/bin or /bin for running executables.
LANG No Set to en_US.UTF-8. This is the locale of the runtime.
LD_LIBRARY_PATH No Contains /lib64, /usr/lib64, LAMBDA_TASK_ROOT, LAMBDA_TASK_ROOT/lib. Used to store helper libraries and function code.
NODE_PATH No Set for the Node.js runtime. It contains LAMBDA_RUNTIME_DIR, LAMBDA_RUNTIME_DIR/node_modules, LAMBDA_TASK_ROOT.
PYTHONPATH No Set for the Python runtime. It contains LAMBDA_RUNTIME_DIR.
TZ Yes The current local time. Defaults to UTC.