You can use the Lambda console to configure function settings, add triggers and destinations, and update and test your code.
To manage a function, open the Lambda console Functions page and choose a function. Under Aliases, choose Latest
. The function designer is near the top of the page.
The designer shows an overview of your function and its upstream and downstream resources.
You can use it to configure triggers, layers, and destinations.
- Triggers – Triggers are services and resources that you have configured to invoke your function. Choose Add trigger to create a Lambda event source mapping or to configure a trigger in another service that the Lambda console integrates with. For details about these services and others, see Using AWS Lambda with other services.
- Layers – Choose the Layers node to add layers to your application. A layer is a .zip file archive that contains libraries, a custom runtime, or other dependencies.
- Destinations – Add a destination to your function to send details about invocation results to another service. You can send invocation records when your function is invoked asynchronously, or by an event source mapping that reads from a stream.
With the Latest
function version selected, you can modify the following settings.
Function settings
-
Code – The code and dependencies of your function. For scripting languages, you can edit your function code in the embedded editor. To add libraries, or for languages that the editor doesn't support, or to create a function deployed as a container image, upload a deployment package. If your deployment package is larger than 50 MB, choose Upload a file from Amazon S3.
-
Runtime – The Lambda runtime that runs your function.
-
Handler – The method that the runtime runs when your function is invoked, such as
index.handler
. The first value is the name of the file or module. The second value is the name of the method. -
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.
-
Execution role – The AWS Identity and Access Management (IAM) role that Lambda assumes when it runs your function.
-
Description – A description of the function.
-
Memory– The amount of memory available to the function at runtime. To set the memory for your function, enter a value between 128 MB and 10,240 MB in 1-MB increments.
-
Timeout – The amount of time that Lambda allows a function to run before stopping it. The default is three seconds. The maximum allowed value is 900 seconds.
-
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).
-
Database proxies – Create a database proxy for functions that use an Amazon RDS DB instance or cluster.
-
Active tracing – Sample incoming requests and trace sampled requests with AWS X-Ray.
-
Concurrency – Reserve 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.
-
Asynchronous invocation – Configure 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.
You can configure error handling settings on a function, version, or alias.
Except as noted in the preceding list, you can only change function settings on the unpublished version of a function. When you publish a version, code and most settings are locked to ensure a consistent experience for users of that version. Use aliases to propagate configuration changes in a controlled manner.
To configure functions with the Lambda API, use the following actions:
- UpdateFunctionCode – Update the function's code.
- UpdateFunctionConfiguration – Update version-specific settings.
- TagResource – Tag a function.
- AddPermission – Modify the resource-based policy of a function, version, or alias.
- PutFunctionConcurrency – Configure a function's reserved concurrency.
- PublishVersion – Create an immutable version with the current code and configuration.
- CreateAlias – Create aliases for function versions.
- PutFunctionEventInvokeConfig – Configure error handling for asynchronous invocation.
For example, to update a function's memory setting with the AWS CLI, use the update-function-configuration
command.
$ aws lambda update-function-configuration --function-name my-function --memory-size 256
For function configuration best practices, see Function configuration.