Skip to main content

AWS Lambda :: Part 1

Updated 3 min readMarkdown
Part of seriesaws-cloud
AWS Lambda :: Part 1

AWS Lambda is a game changing server-less computing service offered by AWS. It allow developer to run code without provisioning managing server. And that's one of the major difference between using EC2 and Lambda function.

While we use EC2, we are responsible for creating and tearing down the instance once our job is done, as per requirement, however when we use Lambda its totally the Lambda function responsibility to create the EC2 and supporting infra for running the application.

Who Decides if Lambda function will be used or EC2 ?

This decision is totally dependent on the DEVELOPER and not the DEVOPS engineer, as they have created the system, so that we the best person to understand and decide if at all the Lambda function to be used or not

Key Benefits:

  1. Serverless: No server management or provisioning required.

  2. Event-driven: Code execution triggered by events, such as API calls or data changes.

  3. Scalability: Automatically scales to handle high traffic or workload.

  4. Cost-effective: Pay only for the compute time consumed.

  5. Supported Language: Supports multiple programming languages, including Node.js, Python, Java, and more.

Use Cases:

  1. Real-time data processing: Imagine you have a photo-sharing app, and users upload images every day. You can use Lambda to automatically resize or compress these images as soon as they are uploaded to S3.

  2. API backend: Develop scalable API backends for web and mobile applications using Lambda. It automatically handles the incoming API requests and executes the corresponding functions..

  3. Automated workflows: Automate tasks and workflows using Lambda functions.

  4. IoT applications: Process and analyse IoT device data.

  5. Machine learning: Run machine learning models and algorithms

  6. Real-Time Analytics: Lambda can process streaming data from IoT devices, social media, or other sources, allowing you to perform real-time analytics and gain insights instantly.

  7. Scheduled Data Backups: Use Lambda to create scheduled tasks for backing up data from one storage location to another, ensuring data resilience and disaster recovery.

Use case 1: All tough below use case is not that much needed by the Devops engineer, but this is jut to get reader introduces with Lambda Service feature and UI

In this use case we are trying to access the application that is not accessible to general public. We are going to use lambda function for this

We should "Enable Function URL" so that we can get a Public IP and IAM User and role. For demo purpose we will set it to "NONE" so that anyone can access it

Then click on "Create", and done your function is created.

Trigger : is basically the event that you want to use, like when the lambda function to be invoked, like s3. Without the help of trigger the whole sense of creating Lamda is useless .

Destination: We can treat it like if particular lambda function is success/ fail and we want to send Notification using SNS, we configure it in Destination

Now just try to access the function Url in Configuration section

Below is the output

No comments yet. Be the first to comment.

aws-cloud

Part 14 of 24

Welcome to my dedicated AWS writing domain. Here, I break down cloud architecture, serverless systems, DevOps best practices, and practical AWS tutorials. This series centralizes all my cloud infrastructure deep dives into one unified space to help you build scalable and secure cloud applications.

Up nextAWS Lambda :: Part 2USE-CASE :: Cost optimisation This use case if used to check if you have any stale Snapshot in your AWS account and delete it . So that Python script checks the which volume and snapshot is present an