Building Lambda functions in Rust
In this video, we're diving deep into real-world challenges, starting with why Rust is great for Lambda functions and how it can save you money. We'll tackle the task of automating tag lists for restaurant menus, moving from Python to Rust for better performance.
In this part, we're getting hands-on with deploying our Rust Lambda function to AWS. We'll talk about the different ways to do it and why we chose the Cargo Lambda toolkit. Despite a few bumps along the way, we'll guide you through the deployment process, even touching on the use of Zig for cross-compilation.
As we move forward, we'll explore SAM (Serverless Application Model) for deploying Lambda functions, sharing practical tips on creating SAM templates and deploying with SAM CLI commands. Join us as we troubleshoot issues, discuss packaging choices, and explain the impact on performance.
Wrapping things up, we'll have a chat about the ups and downs of deployment, with some laughs along the way. We want to thank all our viewers and invite you to subscribe to our YouTube channel for more useful content. Stick around as we plan to visit another streamer's channel for more coding fun!
Chapters:
00:00:00 Intro
00:00:56 Why write Lambda Functions in Rust?
00:02:34 The use case: writing automation for a Restaurant Mobile App
00:07:13 Review of the original Python code
00:11:30 Reviewing the AirTable APIs
00:16:34 Installing Cargo-Lambda and bootstrapping a new project with it
00:20:49 Reviewing the code generated by Cargo-Lambda and changing the event type to a generic JSON
00:26:06 Testing our Lambda locally
00:30:50 Packaging and deploying to AWS with Cargo-Lambda + testing on the AWS web console
00:42:05 Infrastructure as Code with AWS SAM
00:54:35 Deploying our project using SAM
01:13:30 Testing our new SAM application on the AWS web console
01:18:42 Summary
⛓️ Links:
- Code Repository: https://github.com/gambuzzi/tag-updates-lambda
- Cargo Lambda extensions: https://www.cargo-lambda.info
- Crontab editor and validator: https://crontab.guru
- SAM, Serverless Application Model: https://aws.amazon.com/serverless/sam/
- On-demand Container Loading in AWS Lambda (paper): https://arxiv.org/abs/2305.13162
➡️ Follow us on Twitch for more live streams at https://twitch.tv/loige
#Rust #AWS #Lambda #Cloud #serverless