AWS Lambda Basics
- liddellhannah4444
- Mar 2
- 3 min read
Updated: Apr 13

What are Lambdas?
AWS Lambdas are used to run functions on demand without the need for you to set up and manage servers. AWS handles, the scaling, infrastructure and management needed to run your code, because of this you cannot log in to the Lambda compute instances or customise their operating systems.
Lambda structure
Lambdas require that you add you code using specific formats and programming languages for them to run successfully. Functions are primerily added to Lambdas using the code console or using deployment packages. For functions that are only required to run on AWS infrastructure you can add your function directly to the console and utilise Lambda Layers. If you require your function to be more flexible AWS also allows you to use Docker images to fulfil the same purpose.
Code Console
Functions using Python or Node.js can be written directly into the Lambda console which can be found on the AWS Functions page: https://console.aws.amazon.com/lambda/home#/functions.

Deployment Packages
For compiled languages such as C# and Java, creating a deployment package locally and importing it to the Lambda is necessary for adding code to the console (note that you can also create deployment packages for non-compiled languages).

Lambda Layers
Lambda layers are zip file archives that are used to decouple and organise dependencies while reducing the size of your Lambda functions. This is achieved by separating function dependencies and information such as runtime and configuration files into individual layers which can then be shared across multiple Lambda functions. Layers can increase the efficiency of Lambda functions in the AWS console where each Lambda can use up top five layers. However they are not advised to be used alongside languages such as Go and Rust as this can result in a reduced performance for your functions.
Lambdas with Docker
For more complex functions or functions that may be required to be deployed on infrastructure outside of AWS, Docker can be used to format, deploy and store functions in AWS Lambda. Docker images can enhance the versatility of your functions by increasing the function size allowance compared to using Layers in the Console and allowing you to use a greater number of programming languages and formats for your code. Functions deployed using container images cannot utilise Lambda layers and therefore must contain all desired dependency information.
What can you run on Lambdas?
Supported Lambda formats
The Lambda console currently natively supports many common languages such as Python, Java and C# though more languages can be utilised if a Docker container image is used.
Common Lambda use cases
AWS Lambdas are ideal for running code with short run times (approximately less than 15 minutes) and are used frequently in a variety of applications such as IoT backends, file processing and web applications.
How to connect to/trigger a Lambda function
Lambda functions can be invoked in a number of ways. For testing purposes the lambda console can be used for triggering the functions. Lambda functions can also be triggered using the AWS SDK, invoke API, AWS CLI and via using function URLs to create a HTTP/s endpoint. Event driven architecture is also commonly used to trigger Lambda functions via both AWS Eventbridge and direct connections between Lambda and select AWS services. AWS services that support event driven and/or event source mapping invocation can be found in this link: https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html#lambda-invocation-trigger.
Pricing
Lambda pricing is calculated using the function compute time, however this service also offers a free tier below a certain threshold of use. Up to date pricing can be found here: https://aws.amazon.com/lambda/pricing/.
Comments