r/awslambda • • Nov 06 '20

Masterclass: Serverless modernization of monolithic apps

4 Upvotes

WHAT YOU WILL LEARN:

  • How to calculate ROI for Modernization

  • How to identify use cases for Fargate Containers

  • How to identify use cases for Lambda Functions

  • DB Modernization overview

  • How to get started – the first 5 steps

  • Validating business case and scale out

https://cloudwiry.com/monolithic-serverless-modernization/


r/awslambda • • Sep 22 '20

Why can't use OpenCV-Python in AWS Lambda?

4 Upvotes

I've been trying to get OpenCV into an S3 bucket and then assign it to a lambda layer.

Theres very little about this online and what I have seen hasn't worked.

I've managed to use docker with the amazon linux environment, and followed this tutorial. https://aws.amazon.com/premiumsupport/knowledge-center/lambda-layer-simulated-docker/

I've added setuptools, wheel and opencv-python==4.4.0.42 to the requirements.txt file.

setuptools and wheel because of an earlier error where the recommendation was to include these as they need updating, even though I have updated them. But it works with them, so who knows.

Created the docker image which I've zipped and put in an S3 bucket.

I keep getting { "errorMessage": "Unable to import module 'lambda_function': libGL.so.1: cannot open shared object file: No such file or directory", "errorType": "Runtime.ImportModuleError" } when I run it though.

I can't seem to figure out what is wrong.

Any ideas?


r/awslambda • • Jul 22 '19

Why use Microservices

4 Upvotes

Why we need to split the logic?

When a nontechnical person things in an application, he visualizes it as an engine to solve a problem in the company in order to generate money, this monolithic concept is widely propagated across business managers and business owners. It's not wrong, because in order to generate profit, all of the parts should act as one big application, however, the different components should be synchronized and run in a coordinate way. The ability to align those multiple parts is responsibility of the enterprise architects who has to understand the view of the managers/owners that are receiving the profit of the engine and is paying to keep it running in a effective way.

In business side, every day the drivers are changing and the company should adapt to those new drivers smoothly and promptly without loose control over the process and ideally reducing cost and increasing quality. The implementation of each change should be performed in all parts of the company, including applications, and it's better if the applications are modular and easy to assembly returning to the original best practice to have loosely coupled software components, reducing the dependencies between the components and making easy to replace or update one component in the big structure.

In order to reach this model, each task identified on the company, should be implemented as a service and must run independently of the other components, at this point, it's very important to have defined the input, output and exception management of the task that the service will represent, each service will receive a set of parameters and will execute a process to transform the parameters in an output following a deterministic process. Also, the service could generate an action over information, such as write a file, send an email, modify information in a database or over any other resources available in the platform. When you have to update a process due to a new requirement from the business, you have change just the services that are covering tasks that are impacted for this change, trying to keep the input, output and exception process according with the original, if it's not possible, it should modify just an small part of the communication. 

Also, each component should run in an independent environment, allocating his own resources and avoiding coalitions with other task, in the same way, it could be run using a pool of resources able to run a lot of instances of the same task in parallel without mixing data or fighting for resources; in older architectures models this could be solved with a finite pool of instance of the same component pre loaded, this concept solved a lot of issues but it fails when the pooled instances run out of resources and finally generates a crash in the components. In new architectures based in cloud you could configure unlimited instances on-demand that will be instantiated as soon as are invoked. Those instances should not generate any consumption of resources meanwhile it's idle and also doesn't generate any cost to the company.

To communicate micro services we have to establish a common language to move information between the components, usually, this language requeries to identify the main entities that are playing inside the company processes and generate a detailed documentation of each one, taking care of all the posible stages and all the views that could have each entity.

Micro services must be coordinated by an orquestation process that knows all the capabilities of each service and manage the business logic to generate value to the user, this process act a workflow engine with all the steps and conditions requeried to process a business job with all the exceptions and variations

Camilo Garzon

https://camilogarzonjava.blogspot.com/ http://blog.seft.net


r/awslambda • • Dec 20 '18

Considerations for the Beginner Serverless Developer (x-post /r/serverless)

Thumbnail
reddit.com
4 Upvotes

r/awslambda • • Oct 06 '18

Hey Amazon! where is my crop and how to resize in the cloud? A practical guide from a certified developer on how to resize photos in the Cloud.

Thumbnail
medium.com
4 Upvotes

r/awslambda • • Jul 31 '18

Free Serverless Protection Library to Help Harden Your AWS Lambda Apps Just Released

Thumbnail
puresec.io
4 Upvotes

r/awslambda • • Jun 19 '18

Using CPU profiling to increase the efficiency of AWS Lambda Functions

Thumbnail
read.iopipe.com
4 Upvotes

r/awslambda • • Feb 05 '18

Lambda hangs when reading from S3 - but works locally

4 Upvotes

Hi all,

I'm banging my head against a problem, and I don't have any clue on how to solve it.

I wrote a lambda function in October that read its input data from S3, and it worked flawlessly. Since I had to write a bunch of similar function, varying just in the particular logic applied to the S3 file, the lambda is factorized in an infrastructural library + dedicate business code.

In these days I'm working on another of such lambda. I reused the same library (didn't change the code, I mean that was exactly the same library as the one that works) and developed the new business logic. When I deployed my lambda in AWS, it didn't work: the code hangs on acquiring the connection to S3 (s3.getObject()) until the lambda times out.

I tried to update the libraries to the latest version, using both AWS SDK for Java V.1 and the new AWS SDK for Java V.2, without any luck. If I run the code locally by creating a new instance of the lambda class and calling "handleRequest" on it, it's able to retrieve and process the file as intended.

What baffles me is that the preceding lambda continues to work without any problem, so it doesn't seem to be a permission problem.

Apart from the code, the configuration of both the old, working and the new lambda are the same: they run with the same role and neither of them uses VPC.

Can anyone point me in the right direction, please?


r/awslambda • • Jan 19 '18

[DB] ClayBase, instant global database-as-an-API, built for Lambda

Thumbnail base.clay.run
4 Upvotes

r/awslambda • • May 24 '17

A development environment for AWS lambda

Thumbnail
github.com
4 Upvotes

r/awslambda • • Feb 14 '17

CODE WITH ME | SERVERLESS SLACK APP | PART 2 | FooBar

Thumbnail
youtu.be
4 Upvotes

r/awslambda • • Aug 02 '26

Demystifying AWS Lambda misbehavior’s

Thumbnail kwojcicki.github.io
3 Upvotes

r/awslambda • • Dec 28 '25

Awesome alternate for Serverless v4

Thumbnail reddit.com
3 Upvotes

r/awslambda • • Nov 16 '25

Serverless feature flags: Does edge evaluation actually work?

3 Upvotes

Hi everyone,

I have a quick question about feature flags in in AWS Lambda: How do you handle feature flags in Lambda functions? I'm curious about what actually works and what doesn't.

I know that solutions like LaunchDarkly and Statsig now offer Edge Config integrations to cut down on cold start delays, but I'm wondering:

Are you using those integrations? Do they perform as promised?

Or are you still facing delays during cold starts?

What frustrates you about your current setup?

I'm trying to understand the real challenges compared to what marketing claims should work.


r/awslambda • • Apr 26 '24

How to build and auto-deploy docker based AWS Lambda functions with a Github Actions

3 Upvotes

Hello everyone,

I recently faced challenges while automating AWS Lambda function updates directly from GitHub pushes. The main hurdles included managing secrets and dealing with timeouts during updates. After some effort, I've successfully streamlined the process.

For those interested, I've created a detailed guide and included a YAML configuration in a GitHub gist. This might help if you're encountering similar issues. Here's the link to the gist:

https://gist.github.com/DominiquePaul/15be5f5da95b2c30684ecdfd4a151f27

I'm open to feedback and suggestions for further improvement. Feel free to share your thoughts or ask questions if you need more details.


r/awslambda • • Jan 20 '24

Processing Background Jobs on AWS: Lambda vs ECS vs ECS Fargate

Thumbnail
mkdev.me
3 Upvotes

r/awslambda • • Jan 19 '24

Rust lambda hangs on file write… I’m running asynchronous jobs with tokio to write to EFS

3 Upvotes

Basically I have a rust lambda which is creating a bunch of asynchronous jobs to fetch data from a server then write the data to a file

I’m using tokio library. Total number of jobs is like 1000, but I’m only running Like 30 jobs at the same time. (Once 1 job finishes, another job starts).

Basically I get through like 40 jobs then suddenly the lambda hangs when writing to the file.

Any idea why this is happening? I’m writing about 30MB on each file write…

When I invoke the lambda locally it works fine


r/awslambda • • Sep 26 '23

tinymo - a simple DynamoDB wrapper for typescript (for AWS SDK v3) has been updated with an elaborate user guide

Thumbnail
github.com
3 Upvotes

r/awslambda • • Jul 19 '23

S3 CRR Lambda function that resets the retention date on current versions in Glacier that are object locked in Compliance mode

3 Upvotes

Hey guys,

I want to share a Lambda function that I think could be useful for others.

I had a client that wanted to protect his production S3 buckets from ransomware, bad actors, and any other conceivable disastrous event. So I setup Cross Region replication, versioning, and object lock in Compliance mode. This copies the buckets to a new region (should one fail), and makes the bucket contents completely immutable, even from AWS Administrators.

I quickly ran into a problem in the initial design, as you can only set a static value (X days) for the object lock retention policy, which isn't ideal for objects that get new versions often and have a long retention policy (bloat) or objects that are never likely to generate new versions and have short retention policies (unprotected).

This Lambda Function will reset the expiration date on all current versions before they expire, on a reoccurring schedule (daily/weekly/monthly?) . That way you can maintain a shorter value that gets reapplied more often. The idea is to keep all new and old current versions object locked for X days (28), until such time that they become not current. If a version goes non-current or there is a disaster scenario it will not be renewed, and you will have X days (28) before the non-current versions are unlocked and subject to your lifecycle policies. Without the script, object lock would expire at X days and the objects would be vulnerable until a newer version replaces it.

For this to work, you should consider the following (in no particular order)...

  1. Cross Region replication (not required technically)

  2. Versioning (required)

  3. Object Lock in Compliance Mode (required)

  4. Lifecycle Policy to delete non-current versions after retention period (Recommended)

  5. Adequate S3 and CloudWatch permissions

  6. Trigger (CloudWatch events)

  7. Change the Lambda Function Timeout value from 3s to 5m. (General Configuration)

  8. Works on any S3 Storage service (not just Glacier)

Here is the Python script. Don't forget to change the bucket name and the retention days (28):

#Start

#Lambda functions that resets the object lock compliance retention date

import boto3

from datetime import datetime, timedelta

# Replace 'your-bucket-name' with your actual bucket name

bucket_name = 'your-bucket-name'

def extend_object_lock(bucket_name):

s3_client = boto3.client('s3')

# Get the list of all versions of objects with their metadata, including object lock status

response = s3_client.list_object_versions(Bucket=bucket_name)

if 'Versions' not in response:

print("No versions found in the bucket.")

return

# Calculate the new retain until date as 28 days from the current date

new_retain_until_date = datetime.now() + timedelta(days=28)

new_retain_until_date_str = new_retain_until_date.strftime('%Y-%m-%dT%H:%M:%SZ')

for version in response['Versions']:

# Check if the version is the current version

if 'IsLatest' in version and version['IsLatest']:

# Extend the object lock status by updating the metadata of the current version

s3_client.put_object_retention(

Bucket=bucket_name,

Key=version['Key'],

VersionId=version['VersionId'],

Retention={

'Mode': 'COMPLIANCE',

'RetainUntilDate': new_retain_until_date_str

}

)

print(f"Extended the object lock status for current version: {version['VersionId']}")

print(f"New retain until date: {new_retain_until_date_str}")

def lambda_handler(event, context):

# Call the function to extend the object lock status for current versions of objects

extend_object_lock(bucket_name)

#END

Please check us out at xByteHosting.com for Cloud Hosting and Cloud Management Services, should you need our assistance.


r/awslambda • • Jul 10 '23

The Business of Serverless with Yan Cui

Thumbnail
youtube.com
3 Upvotes

r/awslambda • • Jun 20 '23

AWS Lambda Monitoring Tools

Thumbnail
aws.plainenglish.io
3 Upvotes

r/awslambda • • May 02 '23

Lambda handlers + pydantic

3 Upvotes

Hi! I wanted to share a simple pip package that I created to make my lambda function handlers more powerful and easy to use by leveraging pydantic models. The package is this one: pylambdic

Every suggestion you might have is welcome!


r/awslambda • • Apr 15 '23

Aws Data Migration Specialized

3 Upvotes

AWS Data Migration Specialized

Hello, I completed the Learning Path for the AWS Data Migration Specialized and passed the exam. I scored 89% and I was to receive my badge after 5-7 business days. It's 15 days now and nothing has happened. No notification from AWS nor Credly. How much longer should I wait?

Ps: I opened AWS free tier for practice and accidentally started Aurora which billed to $63 before I could stop it. This amount is currently in default. Could this be another issue why they're withholding that Badge?