If you’ve found yourself asking, “what’s the deal with AWS Lambda?” then you’ve come to the right place. I like to think of it as the ultimate “Cloud Glue.” In this post I’ll give an overview of what Lambda is and how you can use it to your advantage.
On a basic level, Lambda is an exciting feature with the potential to become a fundamental building block for AWS services and applications, because it removes the necessity of building entire applications for simple use cases (contact info forms, for example), and allows you to integrate services together with very little friction.
What is Lambda?
AWS Lambda lets you run code without provisioning or managing servers. You pay only for the compute time you consume – there is no charge when your code is not running. With Lambda, you can run code for virtually any purpose – all with zero administration. Just upload your code and Lambda takes care of everything required to run and scale it with high availability. You can set up your code to run on a schedule, trigger based on events from other AWS services, or you can call it directly.
That’s the simple answer. The more complicated one? Lambda is many things. It’s a way to…
- Run simple code without having to build all the apparatus of an application*
- React to events that occur in the cloud*
- Run scheduled tasks*
- Build “Serverless” applications
- Implement Alexa Skill Sets
- Build custom AWS Config Rules
(* Because you are only paying for the time consumed by the task, this can be considerably less expensive than having to run a server that accrues cost each hour.)
How can I run a Lambda function?
There are three options:
- Via API Call (Invoke)
- Web requests through Amazon API Gateway
- In response to an event on AWS: S3; DynamoDB; Kinesis Streams; SNS Notifications; incoming messages from SES; Cognito (Sync Triggers); CloudFormation, CloudWatch (Logs & Events), scheduled events; AWS Config Rules; triggers on changes to code in AWS CodeCommit, etc.
Here are some helpful resources that show you how Lambda is used today, outside of Amazon: