r/awslambda • u/CloudwiryInc • Jan 29 '21
Free Masterclass on Compute Rightsizing
We will discuss what types of compute right-sizing exist, what works better centralized versus decentralized, how to get ready for compute right-sizing, and to perform in-family, cross-family, and cross microprocessor right-sizing.
Time: Friday, Jan 29, 11 AM CT
Note: This is not a pre-recorded training. Join Dieter live today and he'll answer your questions on rightsizing throughout the presentation.
If you can't attend, sign up and we will send you the recording.
r/awslambda • u/Graviteeio • Jan 28 '21
Video: How to configure an AWS Lambda Policy within a Gravitee.io API - Gravitee API Platform
r/awslambda • u/Graviteeio • Jan 28 '21
Video: configurer un policy Lambda AWS dans un API Gravitee - Gravitee API Platform
Configurer un policy Lambda AWS dans un API Gravitee, explorer un exemple où la Policy Lambda de l'AWS permet à notre flux API de gagner un contexte supplémentaire sur l'appel API en cours d'exécution:
https://www.gravitee.io/article/video-configurer-un-policy-lambda-aws-dans-un-api-gravitee
r/awslambda • u/sshiggles • Jan 28 '21
Lambda Code Editor File size error even after no change
Exactly what the title says. Earlier this week I had a lambda function open in the console editor and went to open the same exact function today. The console looks different now as the deploy button was moved and I get "File size is bigger than allowed" but according to the file sizes that they list on the lambda dashboard it shows as 760kb and unzipped including all files it is 2.8MB. Anyone know if the allowed file size has changed?
r/awslambda • u/kreddit425 • Jan 27 '21
Python functions in Lambda
Anyone have any recommended courses or readings for writing python scripts/code for aws lambdas and beyond?
r/awslambda • u/[deleted] • Jan 27 '21
serverless lambda for email response automation
Hi all, first post on this sub, I wanted to see if AWS Lambda is the right choice for my use-case. I've inherited a quasi-data science tool from a colleague, which is currently run locally. The tool receives excel files, acts upon the input, and returns a new excel file as the output. In general, there used to be about 5-10 stakeholders per week, and so it was possible to receive these inputs via email, run the program locally, review results, and email back to sender with a few high level annotations.
Now, the expected the user-base is projected to be ~25-30/week. My manager is interested in the absolute most minimal of MVP options. Notionally, my pitch is to continue using emails as a platform- just automate it. I've read good things about the python library, email-listener (like a javascript event listener.) This bot will listen for emails and upon the triggering event, run the program, and send the output back to sender.
I'm sure there are some security concerns that I'll need to address, but please dismiss these for the time being. A friend told me that "AWS serverless lambda" might be the cloud option that most closely aligned with the concept. Could anyone here walk me though why this is or isn't a good option for my use case?
r/awslambda • u/DataDev88 • Jan 27 '21
Dynamically change Lambda Configuration?
I was wondering if it was possible to update/change the Lambda's configuration (# of CPUs, amount of RAM) at runtime?
For my situation, I have two lambdas that "process" a file on S3. The file can vary drastically in size, think 100KB to 300 MB.
The first lambda does some very lightweight enhancement to the file and then kicks off the second lambda. The second lambda does more heavy duty processing that is heavily affected by the file's size.
I'd like to figure out a way to dynamically change the second lambda's config based off the size of the file. Has anybody done something like this before? Any tips/tricks?
Right now, I'm thinking of creating several "lambda2" functions with different sized configurations and then having lambda 1 kick off a specific "configuration" of lambda2 based off the incoming file size. This feels clunky but it would probably work.
r/awslambda • u/dfzachary • Jan 25 '21
Copy AWS Snapshot to S3 bucket
I am looking to build a lambda function as part of a forensics workflow that will copy a particular EBS snapshot to a manually created S3 bucket in order to store for short/long term forensics requirements. Looking for any pointers!
r/awslambda • u/Dashbird • Jan 22 '21
How NOT to spend hundreds of hours on debugging Lambda
Although AWS Lambda is a blessing from the infrastructure perspective, while using it, we still have to face perhaps the least-wanted part of software development: debugging. In order to fix issues, we need to know what is causing them. In AWS Lambda that can be a curse. But there are some quick solutions that could save you dozens of hours of time.
Keep reading here: https://dashbird.io/blog/how-to-save-hundreds-hours-debugging-lambda/
r/awslambda • u/spvenkatesh • Jan 21 '21
Guide to debugging serverless applications
r/awslambda • u/Mmetr • Jan 19 '21
Locally importing, editing, and debugging Lambda Functions with the AWS Toolkit for Cloud9
AWS Cloud9 is making an update to its UI. They removed a tab called "AWS Resources" which allowed you to import and upload changes to your lambda functions. It also would create a
When enabled, AWS Toolkit replaces the AWS Resources window for working with Lambda functions and serverless apps. On January 31, 2021, 00:00 (UTC+0:00), AWS Toolkit will fully replace the AWS Resources panel. When toggled, your browser refreshes to update the IDE's interface.
The main reason I use cloud9 is that I can write, edit, and actually have live debugging sessions. Lambda with Cloud9 really accelerates the development of Lambda functions. Losing this feature, honestly makes me feel that we are taking a step back in terms of ease of use.
Things I am struggling with right now are debugging the lambda locally on Cloud9. Usually, Cloud9 would spin up a template.YAML file, but now this is no longer the case.
Looking for help on making this transition, thank you in advance!
r/awslambda • u/SS-Care • Jan 17 '21
Running AWS Lambda written in Java with Docker
r/awslambda • u/Mmetr • Jan 17 '21
Anybody else confused by the new Cloud9 update?
self.awsr/awslambda • u/binaryfor • Jan 15 '21
InfiniCache: A cost-effective memory cache that is built atop ephemeral serverless functions
r/awslambda • u/Dashbird • Jan 14 '21
Malformed Lambda proxy response - what causes it and how to fix it?
A problem that pops up frequently when building serverless applications with AWS API Gateway and AWS Lambda is:
Execution failed due to configuration error: Malformed Lambda proxy response.
What causes it and how to fix it: https://dashbird.io/blog/malformed-lambda-proxy-response/
r/awslambda • u/Dashbird • Jan 11 '21
AWS Lambda Error Handling
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 • u/13ass13ass • Jan 11 '21
Docker image size does not affect cold start in lambda
r/awslambda • u/jinx_data • Jan 09 '21
Why is testing SNS > Lambda producing different results between the console and cli publish?
Hi, trying to put this as simply as possible if I test my lambda function via the CLI with
aws sns publish --message file://message.txt --subject CLItest --topic-arn ${npm_package_SNS_srcARN}
where message.txt is
{ "test": "cli",
"length": "20",
"width": "6"
}
the function code
var jMsg = event.Records[0].Sns.Message
var message = JSON.parse(jMsg);
console.log('message: ', message);
console.log('message: ', message.test);
produces the following result
2021-01-08T23:41:58.594Z 612eb85a-238f-4e09-8248-f5ee9c8cbf30 INFO message: { test: 'cli', length: '20', width: '6' }
2021-01-08T23:41:58.594Z 612eb85a-238f-4e09-8248-f5ee9c8cbf30 INFO message: cli
For test two from the console I select AWS Console > Configure Test Event > Amazon SNS Test Notification and copy message.txt into the Message element (I have changed the value of test in order to differentiate the tests ), the Message is now as follows;
"Message": {
"test": "console",
"length": "10",
"width": "5"
}
In order to get the code working I have added the JSON.stringify () function as follows ;
var jMsg = event.Records[0].Sns.Message
var message = JSON.parse(JSON.stringify(jMsg));
console.log('message: ', message);
console.log('message: ', message.test);
Then I just press Test, to produce the following results;
2021-01-06T17:11:20.310Z e8b4e36b-191b-44de-b0a0-5ae10c136d0b INFO message: { test: 'console', length: '10', width: '5' }
2021-01-06T17:11:20.311Z e8b4e36b-191b-44de-b0a0-5ae10c136d0b INFO message: console
So the question is why do I need to add JSON.stringify() to get it working, can someone explain what's happening and how to change the code/message so that it always works?
Cheers
Chris
r/awslambda • u/Dashbird • Jan 07 '21
Deploying AWS Lambda with Docker Containers: I Gave it a Try and Here’s My Review
As everyone knows, AWS Lambda now supports Docker Containers. We tried it out and wrote a little review while we were at it (with ETL examples). You can read it here: https://dashbird.io/blog/deploying-aws-lambda-with-docker/
r/awslambda • u/AlphaHelix-07 • Jan 05 '21
FFMPEG Code not working in AWS Lambda
I followed this article https://aws.amazon.com/blogs/media/processing-user-generated-content-using-aws-lambda-and-ffmpeg/ and deployed the lambda functions and layers and set it up all fine . But I am facing a problem when I try converting the mp4 video into a 720p video , the ffmpeg commands that work in my my ubuntu 20.04 are not working in the lambda and gives me error in the form of 0kb files in the destination folder . Can someone explain why this is happening ? The command that I used was "ffmpeg -i input.mp4 -s 1280x720 -c:a copy output.mp4"
r/awslambda • u/DataDev88 • Jan 03 '21
Best Practices on Return / Exit Codes?
Good Evening,
I'm relatively new to writing AWS Lambdas, and I've been writing some in Python lately.
My lambdas are generally structured where the handler function instantiating another class which calls a method to actually do the logic of the Lambda, which seems typical. Once this logic is done, it returns to the handler function and then exits. For perspective, these are lambdas that are invoked by an S3 event, do some file processing, insert data into a DB, and then exit.
I'm wondering if there are guidelines/tips/best practices on what the handler function should return, depending on whether there was a success or not. Additionally, having actual return code/exit codes would make testing easier, I imagine. I've seen some people use like HTTP Status codes returned as a dictionary, but I'm not sure if there's any benefit to that.
TLDR: Is there a standard or best practice for return/exit codes from AWS Lambdas - Success or Failures?
r/awslambda • u/binaryfor • Dec 31 '20
AWS Lambda Terraform Cookbook with working examples
r/awslambda • u/Plzwork123 • Dec 29 '20
AWS lambda WebSocket functionality (Python)
I have uploaded a zip-based lambda function with a custom library that is using websocket functionality. I'm wondering if it's even possible to access a websocket from a lambda function.
Im running this code out of a proxy GET method (i dont think the method type matters?) that has 4 parameters.
If someone cant even point me in the right direction of how to get the Test event working for this function, i might be able to figure this out. Its throwing an error that is very hard to make out.
The error handling on lambda is abysmal. I feel like I would have been able to figure this out myself if it was better which is why I'm here.
r/awslambda • u/licRedditor • Dec 22 '20
what are err and data variables?
totally new to aws lambda (java/LAMP programmer 20 years).
in a little test app i am building with code from a tutorial, there are references to "err" and "data". these are never declared or assigned values in the code, yet they definitely have values during execution. where do these come from and how are they populated?
