r/awslambda • • Sep 30 '22

Here’s a playlist of 7 hours of music I use to focus when I’m coding/developing. Post yours as well if you also have one!

Thumbnail
open.spotify.com
4 Upvotes

r/awslambda • • Sep 22 '22

Lambda basically Free?

4 Upvotes

My platform is platform is all AWS. It's several ruby apps hosted on EC2 instances that including databases cost me over $1700 a month.

I'm thinking about switching to a Lambda architecture, but I can't believe the pricing I'm seeing. it would only be $100 for 500 million executions of lambda containers that have 10 GB of memory, 10 GB of storage and run for 100 ms?!

I have to figure out how many API calls my app makes, but I know last month I called an external API 500k times, so let's I also call 30 other API endpoints as part of that. Only 15 million Lambda executions.

Wanted to know some initial thoughts instead of hiring a crazy expensive AWS architect. Thanks!


r/awslambda • • Sep 12 '22

I made an AWS CDK stack for taking website screenshots (powered by Puppeteer)

Thumbnail
github.com
4 Upvotes

r/awslambda • • Aug 26 '22

Use of SNS and SQS for message posting

4 Upvotes

We have a requirement to push a certain messages originating from a Spring boot Microservice to a Webhook exposed by external partners. These Webhooks are  REST endpoint protected by oAuth and they accepts JSON payload. 

So , it is 

Microservices [Create JSON payload]  > POST the payload to Webhook1, Webhook 2 etc. 

To decouple the system, I wanted to introduce a Topic. Since we are on AWS, I thought of introducing a SNS topic.. fanning out to SQS triggering Lambdas that actually POST these messages to webhooks. So, it would be 

Microservices [Create JSON payload]  >> POST to SNS Topic >> Fan-out to multiple SQS by filter, where each SQS  is created for a Partner and filtering criteria will ensure relevant message goes to respective SQS created for Partner >> Trigger a lambda from each SQS that runs Java code that perform oAuth and deliver the message to Webhook endpoint. 

I wanted to ask, If you see any flaw in this design.. or you handled this scenario differently in the past? Thanks in advance.


r/awslambda • • May 19 '22

I tested lambda function urls with Austin real-estate example

Thumbnail
youtu.be
4 Upvotes

r/awslambda • • May 11 '22

Designing and Implementing a Multi-Tier Lambda App

Thumbnail
medium.com
4 Upvotes

r/awslambda • • May 06 '22

Setup AWS Lambda in 10 minutes

Thumbnail
youtube.com
4 Upvotes

r/awslambda • • Apr 15 '22

AWS Lambda - CI/CD with AWS SAM, CodePipeline & CloudFormation example

Thumbnail
marcoml.dev
4 Upvotes

r/awslambda • • Mar 28 '22

AWS Certification prep questions with answers and explanation

Thumbnail
youtu.be
4 Upvotes

r/awslambda • • Feb 19 '22

Lamba function role authorization

4 Upvotes

Hi, I'm developing an API using lambdas with serverless framework and one request is to have some endpoints protected with JWT and some sort of role authorization(similar with expressjs middlewares). JWT authentication i figure it out but for the role part i don't know where to start. The stack is nodejs with an Postgres database. The roles(ADMIN, LEVEL1_SUPPORT, LEVEL2_SUPPORT etc.) are stored in a table.

It's possible to have something like this with Lambda?

jwt-check: handler: src/middlewares/jwt.check get-reports: handler: src/handlers/reports.list events: - http: path: reports method: get cors: true authorizer: jwt-check

Thank you.


r/awslambda • • Feb 09 '22

What are AWS Lambda Layers and when should I use them?

Thumbnail
aws.hashnode.com
4 Upvotes

r/awslambda • • Jan 05 '22

Zero Friction AWS Lambda Instrumentation: A Practical Guide to Extensions

Thumbnail
aws.amazon.com
4 Upvotes

r/awslambda • • Sep 22 '21

How to return CSV file from Lambda function ?

4 Upvotes

Hi, I am writing some lambda functions which run scripts on different databases and generate a CSV file (in the /tmp/ directory). These functions can be triggered through Api Gateway endpoints.

Is there any way to return the generated CSV file directly and trigger a download when the API endpoint is hit from a browser ?

P.S - I found articles about how to return binary data, but couldn't figure out how to do the same with CSV files


r/awslambda • • Aug 07 '21

How to share code between lambdas

Thumbnail
link.medium.com
4 Upvotes

r/awslambda • • Jul 24 '21

How to Provision AWS Lambda Functions with Terraform

4 Upvotes

Hey guys,

Shanky Mendiratta just wrote a new blog post on Lambda you may enjoy on the ATA blog.

"How to Provision AWS Lambda Functions with Terraform"

Summary: Using Terraform and AWS Lambda functions, build a serverless infrastructure in no time with this step-by-step tutorial!

https://adamtheautomator.com/terraform-aws-lambda/


r/awslambda • • Jul 14 '21

Hosting your own email forwarding service on AWS and manage it with Github Actions

Thumbnail
github.com
4 Upvotes

r/awslambda • • Jun 25 '21

Discussion: Bast practices for mapping API endpoints in AWS

4 Upvotes

I am a director of engineering who inherited an interesting problem. The previous person was building a web application by creating hundred of Node JS API endpoints and mapping each to run as a lambda method. This seems like a slightly odd way of doing things. Lambdas seem to me to be a really great way to take a single process and dynamically scale it by duplicating the code for running that single process. I am not sure that splitting up a pool of X lambda instances across several hundred differing endpoints will scale as smoothly.

If I were building a design to solve that problem, I'd probably just use an AWS gateway API service. If I had to break the logic up, perhaps I'd aggregate the endpoints into a few controllers comprised of endpoints with similar concerns (users, products, admin, etc) so you just end up with a few unique process that could be put in their own lambda pools.

Am I missing something here? I cannot put my finger on it, but this pattern seems like a code smell....


r/awslambda • • Apr 28 '21

What are AWS Lambda triggers? (intro for beginners)

4 Upvotes

AWS Lambda triggers are actions caused by specific AWS resources; these actions generate events that will further execute Lambda functions that listen to them. Here's exactly how it works: https://dashbird.io/blog/what-are-aws-lambda-triggers/


r/awslambda • • Mar 29 '21

Performance of running Spring Boot as AWS Lambda functions

Thumbnail
arnoldgalovics.com
4 Upvotes

r/awslambda • • Jan 11 '21

AWS Lambda Error Handling

4 Upvotes

Discussing the basics of AWS Lambda error handling and some popular methods using StepFunctions and X-Ray in this article: https://dashbird.io/blog/aws-lambda-error-handling-step-functions/


r/awslambda • • Jan 11 '21

Docker image size does not affect cold start in lambda

Thumbnail
mikhail.io
4 Upvotes

r/awslambda • • Dec 20 '20

Lambda Execution Leaks: A Practical Guide | Lumigo

Thumbnail
medium.com
4 Upvotes

r/awslambda • • Dec 05 '20

How to improve performance of initial calls to AWS services from an AWS Lambda (Java)?

4 Upvotes

I recently tried to analyze some performance issues on a service hosted in AWS Lambda.
Breaking down the issue, I realized that it was only on the first calls on each container.
When isolating the issue, I found myself creating a new test project to get a simple example.

Test project: https://github.com/wietlol/AwsLambdaPerformanceTests
(You can clone it, build it "mvn package", deploy it "sls deploy" and then test it via the AWS Management Console.)

This project has 2 AWS Lambda functions: "source" and "target".
The "target" function simply returns an empty json "{}".
The "source" function invokes the "target" function using the AWS Lambda SDK.

The approximate duration of the "target" function is 300-350 ms on cold starts and 1ms on hot invokes.
The approximate duration of the "source" function is 6000-6300ms on cold starts and 280ms on hot invokes.

The 6 seconds overhead on the cold starts of the "source" function appear to be 3 seconds of getting the client and 3 seconds of invoking the other function, in hot invokes that is 3ms and 250ms respectively.
I get similar times for other services like AWS SNS.

I dont really understand what it is doing in those 6 seconds and what I can do to avoid it.
When doing warmup calls, I can get the client and store the reference to avoid the first few seconds, but the other few seconds come from actually using the other service (SNS, Lambda, etc), which I can't really do as a no-op.

So, do other people experience the same cold start durations and what can I do to increase the performance on that? (other than bringing the memory setting up)