Configuring Lambda function options - AWS Lambda

Configuring Lambda function options

After you create a function, you can configure additional capabilities for the function, such as triggers, network access, and file system access. You can also adjust resources associated with the function, such as memory and concurrency. These configurations apply to functions defined as .zip file archives and to functions defined as container images.

You can also create and edit test events to test your function using the console.

For function configuration best practices, see Function configuration.

Function versions

A function has an unpublished version, and can have published versions and aliases. By default, the console displays configuration information for the unpublished version of the function. You change the unpublished version when you update your function's code and configuration.

A published version is a snapshot of your function code and configuration that can't be changed (except for a few configuration items relevant to a function version, such as provisioned concurrency).

Using the function overview

The Function overview shows a visualization of your function and its upstream and downstream resources. You can use it to jump to trigger and destination configuration. You can use it to jump to layer configuration for functions defined as .zip file archives.

        The Lambda function overview, with no configured triggers or destinations.

Configuring functions (console)

For the following function configurations, you can change the settings only for the unpublished version of a function. In the console, the function Configuration tab provides the following sections:

  • General configuration – Configure memory or opt in to the AWS Compute Optimizer. You can also configure function timeout and the execution role.

  • Permissions – Configure the execution role and other permissions.

  • Environment variables – Key-value pairs that Lambda sets in the execution environment. To extend your function's configuration outside of code, use environment variables.

  • Tags – Key-value pairs that Lambda attaches to your function resource. Use tags to organize Lambda functions into groups for cost reporting and filtering in the Lambda console.

    Tags apply to the entire function, including all versions and aliases.

  • Virtual private cloud (VPC) – If your function needs network access to resources that are not available over the internet, configure it to connect to a virtual private cloud (VPC).

  • Monitoring and operations tools – configure CloudWatch and other monitoring tools.

  • ConcurrencyReserve concurrency for a function to set the maximum number of simultaneous executions for a function. Provision concurrency to ensure that a function can scale without fluctuations in latency. Reserved concurrency applies to the entire function, including all versions and aliases.

  • Function URL – Configure a function URL to add a unique HTTP(S) endpoint to your Lambda function. You can configure a function URL on the $LATEST unpublished function version, or on any function alias.

You can configure the following options on a function, a function version, or an alias.

  • Triggers – Configure triggers.

  • Destinations – Configure destinations for asynchronous invocations .

  • Asynchronous invocationConfigure error handling behavior to reduce the number of retries that Lambda attempts, or the amount of time that unprocessed events stay queued before Lambda discards them. Configure a dead-letter queue to retain discarded events.

  • Code signing – To use Code signing with your function, configure the function to include a code-signing configuration.

  • Database proxiesCreate a database proxy for functions that use an Amazon RDS DB instance or cluster.

  • File systems – Connect your function to a file system.

  • State machines – Use a state machine to orchestrate and apply error handling to your function.

The console provides separate tabs to configure aliases and versions:

  • Aliases – An alias is a named resource that maps to a function version. You can change an alias to map to a different function version.

  • Versions – Lambda assigns a new version number each time you publish your function. For more information about managing versions, see Lambda function versions.

You can configure the following items for a published function version:

  • Triggers

  • Destinations

  • Provisioned concurrency

  • Asynchronous invocation

  • Database proxies

Configuring functions (API)

To configure functions with the Lambda API, use the following actions:

Configuring function memory (console)

Lambda allocates CPU power in proportion to the amount of memory configured. Memory is the amount of memory available to your Lambda function at runtime. You can increase or decrease the memory and CPU power allocated to your function using the Memory (MB) setting. To configure the memory for your function, set a value between 128 MB and 10,240 MB in 1-MB increments. At 1,769 MB, a function has the equivalent of one vCPU (one vCPU-second of credits per second).

You can configure the memory of your function in the Lambda console.

To update the memory of a function

  1. Open the Functions page of the Lambda console.

  2. Choose a function.

  3. On the function configuration page, on the General configuration pane, choose Edit.

  4. For Memory (MB), set a value from 128 MB to 10,240 MB.

  5. Choose Save.

Configuring ephemeral storage (console)

By default, Lambda allocates 512 MB for a function’s /tmp directory. You can increase or decrease this amount using the Ephemeral storage (MB) setting. To configure the size of a function’s /tmp directory, set a whole number value between 512 MB and 10,240 MB, in 1-MB increments.


Configuring ephemeral storage past the default 512 MB allocated incurs a cost. For more information, see Lambda pricing.

You can configure the size of a function’s /tmp directory in the Lambda console.

To update the size of a function’s /tmp directory

  1. Open the Functions page of the Lambda console.

  2. Choose a function.

  3. On the function configuration page, on the General configuration pane, choose Edit.

  4. For Ephemeral storage (MB), set a value from 512 MB to 10,240 MB.

  5. Choose Save.

Accepting function memory recommendations (console)

If you have administrator permissions in AWS Identity and Access Management (IAM), you can opt in to receive Lambda function memory setting recommendations from AWS Compute Optimizer. For instructions on opting in to memory recommendations for your account or organization, see Opting in your account in the AWS Compute Optimizer User Guide.


Compute Optimizer supports only functions that use x86_64 architecture.

When you've opted in and your Lambda function meets Compute Optimizer requirements, you can view and accept function memory recommendations from Compute Optimizer in the Lambda console.

To accept a function memory recommendation

  1. Open the Functions page of the Lambda console.

  2. Choose a function.

  3. On the function configuration page, on the General configuration pane, choose Edit.

  4. Under Memory (MB), in the memory alert, choose Update.

  5. Choose Save.

Configuring triggers (console)

You can configure other AWS services to trigger your function each time a specified event occurs.

For details about how services trigger Lambda functions, see Using AWS Lambda with other services.

To add a trigger to your function.

  1. Open the Functions page of the Lambda console.

  2. Choose the function to update.

  3. Under Function overview, choose Add trigger.

  4. From the drop-down list of triggers, choose a trigger. The console displays additional configuration fields required for this trigger.

  5. Choose Add.

Testing functions (console)

You can create test events for your function from the Test tab. For more information, see Testing Lambda functions in the console.

You can also invoke your function without saving your test event by choosing Test before saving. This creates an unsaved test event that Lambda will preserve for the duration of the session. You can access your unsaved test events from either the Test or Code tab.