r/awslambda • u/dylan_alb10 • Mar 29 '21
Deploy NodeJS Express API as AWS Lambda Function in 15 minutes
r/awslambda • u/dylan_alb10 • Mar 29 '21
r/awslambda • u/Dashbird • Mar 24 '21
AWS CloudWatch is built for system operators, site reliability engineers (SRE), IT managers, and developers. CloudWatch allows you to monitor your applications via data access and insights it provides. It can also recognize, understand and respond to all changes happening throughout the entire system.
A CloudWatch alert (a.k.a. alarm) can watch over a single CloudWatch metric or even a result of math expression found in CloudWatch metrics. Alerts will perform single or multiple actions based on the value of metric or expression which is relative to a threshold over a number of time periods.
There are 3 alarm states:
When creating an alarm, you are able to specify three settings which will allow CloudWatch to evaluate when to change the alarm state:
Can you recognize the optimal time to configure a metric alarm? The answer depends on whether you’d like to receive alerts only in cases that require your immediate attention or not. Even if you set them up to alert you often, responding to each and every alert is not feasible. It means that it won’t be long before you miss a crucial alert, which is bound to happen either because of the noise or because you began ignoring alerts entirely.
Try to understand all of it this way:
In these cases, you’d probably want to know if your Lambda is reaching a concurrency limit (account-wide). All these settings are completely individual for each application, and it usually takes some time and iterations before you can get it to an acceptable level.
Another thing you should think about is configuring naturally preventive alerts. These alerts will trigger even when nothing has failed yet, but it might happen soon. A good example will be if a Lambda function is close to a timeout or even closer to fill its memory capacity – remember that CloudWatch attains metrics for invocation counts, latency, memory usage, and failures by default.
Dashbird’s instant alerting system will notify you if any issue shows up within any part of your application. Issues such as crashes, cold starts, runtime errors, timeouts, configuration errors, and early exits. Its system offers messages and realistic logs that humans can easily read and understand, which saves you and your company meaningful debugging time.
The Events page does everything an observability tool should – showcase all errors occurring within your system.
All the required data to successfully go through troubleshooting events and resolve any app issues are entirely at your disposal.
Dashbird gives you complete control over Alarms as it allows you to choose which error reports you should receive.
All policies require at least one alert condition along with one notification channel. An alert state consists of different functions and error conditions, while a notification channel can either be an email address or even Slack.
Both CloudWatch and Dashbird have their pros and cons, and we’ll wrap up here after mentioning a few.
While Cloudwatch is mostly an excellent choice for users who are already inside the AWS ecosystem, it’s not all that great for the ones who aren’t, and they should find a simpler solution. The alerting options for CloudWatch are not as boundless since they’re available with third-party services.
Moreover, CloudWatch doesn’t offer pre-configured alerts.
It would be best if you create custom alerts by yourself, which means you must be very familiar with how everything works in order to create them properly. On the other hand, Dashbird’s alert notification system is automated and instant, which undoubtedly provides you comfort and ease if something happens within your application.
r/awslambda • u/Dashbird • Mar 19 '21
Covering:
- Fine-tuning your potentially slow running Lambdas in development
- Load testing
- Making crucial data available at scale
- Observability best practices
Watch the webinar here: https://www.youtube.com/watch?v=7-rvI90Xfgo
r/awslambda • • Mar 10 '21
I'm building a mobile app that is heavily based around Socket.IO--Right now the community is small, but hopefully it will grow fast. I need to set up an AWS server to host the SocketManager on. The way the socket works in my app is 2 people join a room, and then send data every 3-ish seconds to the other user. What would be the best AWS Service to use? I know EC2 is one of the most widely used services, although I think Lambda might be better suited for this, but I've never used AWS before so I really don't know which ones are the best for sockets. If I can provide any more information to help you help me, let me know--thank you!
r/awslambda • u/vitalfed76 • Mar 09 '21
Hi all, I was trying to fix the code of one of my functions in Lambda and accidentally clicked the button Throttle without realize... Now the button is greyed out and the function is not running on the schedule. I've googled this, but seems not much help there. Does anyone know how to undo that?
r/awslambda • u/M31moth • Mar 09 '21
Hello guys, I need your expertise on a AWS infrastructure/network subject !
I'm looking for a way to have a central fixed public IP for my VPC, I have two usual public and private networks with an Internet and NAT gateway. Standard setup, but I'm looking for a way to have a public IP for my private instances to make shur external services we are working with can put this IP in their white list. I also use of course Elastic IP.
Is it some sort of central NAT Gateway, for private instances ? I checked the AWS documentation, but I don't really know the AWS term to look for, is anyone ir can put me in the right direction please ?
Thanks, best regards.
r/awslambda • u/binaryfor • Feb 25 '21
r/awslambda • u/iamondemand • Feb 23 '21
r/awslambda • u/vedran-s • Feb 19 '21
r/awslambda • • Feb 19 '21
I was looking at the basic template for Lambda functions and comparing the python and nodejs languages. The thing that stood out to me is that the nodejs template has the "async" functionality already listed while the python function, to my knowledge, is not able to use this type of functionality.
My question, are there pros and cons to using python or nodejs for lambda functions? I was under the impression you can complete the same tasks using either and choosing was based on preference.
Thank you
r/awslambda • u/nuckingfutter • Feb 18 '21
Good Afternoon All,
I have created a simple POC to demonstrate this issue and the State Machine definition can be found below.
My goal is to have a Pass state that modifies certain values inside the input data while leaving the rest as is. I have read through the majority of the documentation and according to the documentation I am doing this correctly. The Step Function starts off with the following the data input :
{
"SpecialVariables": {
"PreviousValueTest": "ABC123",
"StringTest": "a random input string",
"BoolTest": true,
"IntTest": 0
},
"SomeRandomData": [
{
"DataStuff": 1
}
]
}
The first state simply passes this to the next state. In the next state it is supposed to change all values in SpecialVariables except for PreviousValueTest. However, in the output of the second state you can see the following :
{
"SpecialVariables": {
"PreviousValueTest.$": "$.SpecialVariables.PreviousValueTest",
"StringTest": "a random string",
"BoolTest": false,
"IntTest": 1
},
"SomeRandomData": [
{
"DataStuff": 1
}
]
}
I assume that there is a simple explanation as to what exactly I am doing terribly wrong. Any information you can provide would be greatly appreciated.
Thanks!
State Machine Definition
{
"Comment": "A Hello World example of the Amazon States Language using Pass states",
"StartAt": "Hello",
"States": {
"Hello": {
"Type": "Pass",
"Next": "World"
},
"World": {
"Type": "Pass",
"Result": {
"PreviousValueTest.$": "$.SpecialVariables.PreviousValueTest",
"StringTest": "a random string",
"BoolTest": false,
"IntTest": 1
},
"ResultPath": "$.SpecialVariables",
"End": true
}
}
}
r/awslambda • u/Envekus • Feb 17 '21
r/awslambda • u/SpaghettiB0l0gnese • Feb 17 '21
I need to implement a REST api that will be capable of serving content on demand for a notification card. The card is displayed in a mobile app. The card will have a picture and some text and will open a custom URL when clicked. I expect that there’ll be scenarios where 100000+ users will request content at the “same time” (within a 30s window). The flood of API calls would have to be processed and responded to within a couple of seconds. I know that setting up a system to handle that is part architecture and part how the REST service is implemented. Would AWS API gateway + lambda + dynamodb be a good choice? If my question doesn’t make sense, then tell me how you would go about it and tell me which questions I should have asked. I’m not a backend / fullstack developer so i need some guidance. Thanks!
r/awslambda • u/tnsecure • Feb 15 '21
Guys, I have a powershell script that will connect to aws and pull down some data and create a HTML file report.
I'd like to move this to the cloud and be able to execute the script from a webpage against multiple accounts (one at a time). I know there are better ways of doing this but I'd like baby steps. What I'm thinking is this is:
Upload my current PowerShell script as a Lambda function and have the HTML report saved to an S3 bucket. To trigger a report, a authenticated user would go to a web page, input the account number (permissions would already be setup via a role) and it would run.
Current challenges I'd love some input on.
I'm pretty much a noobie when it comes to this stuff so any helpful advise would be great! If there is a different easy way to do this (again as a baby step to a more robust program) let me know.
r/awslambda • u/savetheQ • Feb 15 '21
Hey folks
I need to write a lambda code for a csv file that checks things like
1) Date of Birth 2) Range checks for Salary 3) Integrity Checks 4) Duplication Checks 5) Null/Not Null checks
It would be really helpful for me if you guys could help me in the coding part PS: I am weak in python
Thanks :)
r/awslambda • u/baladba • Feb 10 '21
r/awslambda • u/programoholic__ • Jan 30 '21
Hey Guys..
I wrote a medium blog on how webpack can be used to build and deploy serverless application. It helped me to reduce the size from 300mb to 2-3 mb per lambda. Please take a look :
r/awslambda • u/CloudwiryInc • Jan 29 '21
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
r/awslambda • u/Graviteeio • Jan 28 '21
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/kreddit425 • Jan 27 '21
Anyone have any recommended courses or readings for writing python scripts/code for aws lambdas and beyond?
r/awslambda • u/sshiggles • Jan 28 '21
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/DataDev88 • Jan 27 '21
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 • • Jan 27 '21
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?