Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Con?guring AWS Lambda Functions

Author: Madhu Dm
by Madhu Dm
Posted: Aug 24, 2019

You can use the AWS Lambda API or console to con?gure settings on your Lambda functions. Basic function settings include the description, role, and runtime that you specify when you create a function in the Lambda console. You can con?gure more settings after you create a function, or use the API to set things like the handler name, memory allocation, and security groups during creation. For More Information About AWS Lambda

To keep secrets out of your function code, store them in the function's con?guration and read them from the execution environment during initialization. Environment variables are always encrypted at rest, and can be encrypted in transit as well. Use environment variables to make your function code portable by removing connection strings, passwords, and endpoints for external resources.

Versions and aliases are secondary resources that you can create to manage function deployment and invocation. Publish versions of your function to store its code and con?guration as a separate resource that cannot be changed, and create an alias that points to a speci?c version. Then you can con?gure your clients to invoke a function alias, and update the alias when you want to point the client to a new version, instead of updating the client.

As you add libraries and other dependencies to your function, creating and uploading a deployment package can slow down development. Use layers to manage your function's dependencies independently and keep your deployment package small. You can also use layers to share your own libraries with other customers and use publicly available layers with your functions.

To use your Lambda function with AWS resources in an Amazon VPC, con?gure it with security groups and subnets to create a VPC connection. Lambda uses elastic network interfaces (ENIs) to create the connection, so you need to ensure that your account has enough ENI capacity to handle the number of connections made as your function scales up under load.

AWS Lambda Function Con?guration

A Lambda function consists of code and any associated dependencies. In addition, a Lambda function also has con?guration information associated with it. Initially, you specify the con?guration information when you create a Lambda function.

To con?gure function settings

1. Open the Lambda console. 2. Choose a function. 3. Con?gure any of the available options and then choose Save.

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, upload a deployment package.

  • Runtime – The Lambda runtime that executes your function.
  • Handler – The method that the runtime executes when your function is invoked. The format for this value varies per language. See Programming Model for more information.
  • Environment variables – Key-value pairs that Lambda sets in the execution environment. Use environment variables to extend your function's con?guration outside of code.
  • Tags – Key-value pairs that Lambda attaches to your function resource. Use tags to organize Lambda functions into groups for cost reporting and?ltering in the Lambda console.Tags apply to the entire function, including all versions and aliases.
  • Execution role – The IAM role that AWS Lambda assumes when it executes your function.
  • Description – A description of the function.
  • Memory – The amount of memory available to the function during execution. Choose an amount between 128 MB and 3,008 MB in 64 MB increments.Lambda allocates CPU power linearly in proportion to the amount of memory con?gured. At 1,792 MB, a function has the equivalent of 1 full vCPU (one vCPU-second of credits per second).
  • Timeout – The amount of time that Lambda allows a function to run before stopping it. The default is 3 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, con?gure it to connect to a VPC.
  • Dead letter queue (DLQ) – If your function is invoked asynchronously, choose a queue or topic (p. 88) to receive failed invocations.
  • Enable active tracing – Sample incoming requests and trace sampled requests with AWS XRay.
  • Concurrency – Reserve concurrency for a function to set the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency level.

Take your career to new heights of success with a AWS Online Training

About the Author

I am a Cloud Developer and Content Writer and We also Providing the Online Training's like Aws Online Training

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Madhu Dm

Madhu Dm

Member since: Apr 19, 2019
Published articles: 2

Related Articles