All about Learning AWS Lambda 

In this section, you will be learning AWS Lambda component, functions and features at length.

  • It is a compute service
  • Runs code without provisioning or managing servers.
  • It executes code only when needed and scales automatically
  • Upload code and Lambda takes care of everything.
  • Set up code to automatically trigger from other AWS services
  • Call Code directly from any web or mobile app.
  • Code can be executed against triggers – changes in data, shifts in system state, or actions by users. Direct trigger from AWS services – S3, DynamoDB, Kinesis, SNS, and CloudWatch
  • Trigger can be orchestrated into workflows by AWS Step Functions.
  • Can build a variety of real-time serverless data processing systems.
  • Customer is responsible only for code.
  • Lambda manages the memory, CPU, network, and other resources.
  • You cannot log in to compute instances, or customize the operating system or language runtime.

Lambda Working

  • Lambda runs functions in a serverless environment to process events.
  • Each instance of function runs in an isolated execution context
  • one event at a time is processed.
  • After finishing event processing, a response is returned and Lambda sends it another event.

Lambda Components

  • Function – A script or program that runs in AWS Lambda. Lambda passes invocation events to function. The function processes an event and returns a response.
  • Runtimes – Lambda runtimes allow functions in different languages to run in the same base execution environment. You configure function to use a runtime that matches programming language. The runtime sits in-between the Lambda service and function code, relaying invocation events, context information, and responses between the two. You can use runtimes provided by Lambda, or build own.
  • Layers – Lambda layers are a distribution mechanism for libraries, custom runtimes, and other function dependencies. Layers let you manage in-development function code independently from the unchanging code and resources that it uses. You can configure function to use layers that you create, layers provided by AWS, or layers from other AWS customers.
  • Event source – An AWS service, such as Amazon SNS, or a custom service, that triggers function and executes its logic.
  • Downstream resources – An AWS service, such as DynamoDB tables or Amazon S3 buckets, that Lambda function calls once it is triggered.
  • Log streams –Lambda monitors function invocations and reports metrics to CloudWatch. Annotate function code with custom logging statements to analyze the execution flow and performance of Lambda function to ensure it’s working properly.
  • AWS SAM – A model to define serverless applications. AWS SAM is natively supported by AWS CloudFormation and defines simplified syntax for expressing serverless resources.

Lambda function configuration, deployments, and execution limits.

ResourceLimit
Function memory allocation128 MB to 3,008 MB, in 64 MB increments.
Function timeout900 seconds (15 minutes)
Function environment variables4 KB
Function resource-based policy20 KB
Function layers5 layers
Invocation frequency (requests per second)10 x concurrent executions limit (synchronous – all sources) 10 x concurrent executions limit (asynchronous – non-AWS sources) Unlimited (asynchronous – AWS service sources)
Invocation payload (request and response)6 MB (synchronous) 256 KB (asynchronous)
Deployment package size50 MB (zipped, for direct upload) 250 MB (unzipped, including layers) 3 MB (console editor)
Test events (console editor)10
/tmp directory storage512 MB
File descriptors1,024
Execution processes/threads1,024

AWS Lambda-based application lifecycle

  • authoring code
  • deploying code to AWS Lambda
  • monitoring and troubleshooting

AWS Lambda supported languages, their tools and options

LanguageTools and Options for Authoring Code
Node.jsAWS Lambda consoleVisual Studio, with IDE plug-in own authoring environment
JavaEclipse, with AWS Toolkit for Eclipse IntelliJ, with the AWS Toolkit for IntelliJown authoring environment
C#Visual Studio, with IDE plug-in .NET Core own authoring environment
PythonAWS Lambda console PyCharm, with the AWS Toolkit for PyCharmown authoring environment
RubyAWS Lambda console own authoring environment
Goown authoring environment
PowerShellown authoring environment PowerShell Core 6.0 .NET Core 2.1 SDK AWSLambdaPSCore Module

Want to become AWS Certified SysOps Administrator – Associate with hundreds of real-time practice exam and expert guidance Now!

Menu