AWS::Lambda::Function Environment - AWS CloudFormation
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.

AWS::Lambda::Function Environment

A function's environment variable settings. You can use environment variables to adjust your function's behavior without updating code. An environment variable is a pair of strings that are stored in a function's version-specific configuration.

Syntax

To declare this entity in your CloudFormation template, use the following syntax:

JSON

{ "Variables" : {Key: Value, ...} }

YAML

Variables: Key: Value

Properties

Variables

Environment variable key-value pairs. For more information, see Using Lambda environment variables.

If the value of the environment variable is a time or a duration, enclose the value in quotes.

Required: No

Type: Object of String

Pattern: [a-zA-Z][a-zA-Z0-9_]+

Update requires: No interruption

Examples

Environment Variables

Add environment variables to a function. Each variable is a key-value pair. This example specifies values for a databaseName and a databaseUser.

YAML

Environment: Variables: databaseName: lambdadb databaseUser: admin