Building Lambda functions in Rust - part 2
In this live coding session we delve deep into the Rust programming language and use it together with AWS Lambda!
In this session, we cover a plethora of topics, including:
- API Interaction: Learn how to make HTTP requests, handle responses, and parse JSON data in Rust. We demonstrate how to effectively use libraries like reqwest for sending requests and serde for JSON serialization and deserialization. We also show how to properly compile reqwest to work in the context of AWS Lambda.
- Error Handling Strategies: we dive into error handling techniques in Rust, including how to handle different HTTP status codes, gracefully handle errors, and propagate errors throughout the codebase.
- Asynchronous Operations: we explore asynchronous programming in Rust using async/await syntax.
- Environment Variables and Parameter Passing: when showcase the importance of environment variables in Rust applications and learn how to pass parameters to functions effectively through AWS Cloudformation parameters defined in our SAM stack. We demonstrate how to read environment variables and pass them to AWS Lambda functions for deployment.
Deployment with AWS Lambda: Witness the deployment process of Rust code using AWS Lambda. Follow along as we discuss the setup, configuration, and deployment steps involved in deploying Rust code to AWS Lambda.
Advanced Rust Features: Delve into advanced Rust features such as generics and traits. Learn how to write flexible and reusable code using generics and implement traits to define behavior for types.
Throughout the session, we provide detailed explanations, debug code live, and refactor for better code organization. We also discuss optimization techniques for performance and readability, ensuring you come away with practical insights into Rust development.
Whether you're a beginner eager to learn Rust programming or an experienced developer seeking to level up your skills, this live coding session offers valuable knowledge and hands-on experience. Join us as we navigate through the complexities of Rust development and tackle real-world challenges head-on.
Don't miss out on this opportunity to enhance your Rust proficiency! Like, subscribe, and hit the notification bell to stay updated on future live coding sessions, tutorials, and insightful content. Happy coding!
Chapters:
00:00:00 Intro
00:01:12 Recap of the previous steps and on the goal of this project
00:02:43 Review of the Python prototype code
00:05:58 Adding a parameter and an environment variable for the AirTable API key
00:20:11 Making HTTP requests from Rust using the Reqwest crate
00:30:47 Parsing JSON data from HTTP requests using serde and serde_json
01:00:56 Generalising the AirTable responses using Rust generics and the serde DeserializeOwned trait
01:14:39 Covering what we want to do in the next stream and wrap up
⛓️ Links:
- Our 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
Other Videos By Luciano Mammino (loige)
Other Statistics
Rust Statistics For Luciano Mammino (loige)
There are 1,740 views in 26 videos for Rust. There's over 1 day worth of watchable video for Rust published on his channel, or 20.00% of the total watchable video on Luciano Mammino (loige)'s YouTube channel.