CategoriesInfrastructureServerless

Guaranteed Safety using Blue Green with ECS and CDK

Buckle up for this one as it’s going to be a lengthy piece. I love writing articles like this one because they contain complete infrastructure builds that highlight some best practices to put multiple components together and act as great starting points for people to use immediately. I’ve been working a great deal with containers lately and I kept finding it difficult to locate a working sample of building Blue Green with ECS and CDK. So I set out to put that together. Let’s get started.

CategoriesServerless

An Allow List Lambda Function in Rust is 1 Guaranteed Way to Improve CORS

Some time ago I wrote an article about Cross-Origin Resource Sharing with API Gateway that talks about custom allow lists. I wanted to revisit that implementation not because the code doesn’t work, but because I wanted to see what it would look like in Rust. Remember, I believe that more developers would be choosing Rust with Serverless if more content and examples existed. Let’s dive into building a Lambda Function in Rust for CORS.

CategoriesServerless

A Proven and Comprehensive Pattern for Building an API with Rust and Lambda

I’ve been encouraged lately by all of the Rust and Serverless content that has been posted on various platforms. I’ve also been public about the fact that I believe that Rust adoption with Serverless would be further along if there was more quality content written on the topic. I know for certain that there is interest from developers about whether they should and how would they introduce Rust into their builds and while I’ve tackled pieces of the puzzle, I haven’t taken on a fully working CRUD API. This article looks to change that. Let’s dive into building an API with Rust and Lambda.

CategoriesServerless

Blazing Fast Change Data Capture with DynamoDB Streams and Rust

Propagating changes in an event-driven system can be accomplished in many different ways with many different tools. Do I work with transaction logs, put events on an event bus or do something else? Fortunately, when storing data in AWS’ DynamoDB I can take advantage of the DynamoDB streams feature. DynamoDB Streams gives me an iterator that I can read from to publish or process item-level changes outside of the transaction of persisting the data from the originating client. I’ve written about streams before, here, here and here but in this article I want to look at DynamoDB Streams and Rust.

CategoriesPersonalProgrammingServerless

My Personal Serverless Rust Developer Experience. It’s Better Than You Think

One of the things that can be difficult when starting with a new technology, framework or tool is where to get started. That “get started” can mean a great many things to many people. Over the past 6 months or so, I’ve been learning and deploying Rust into production in AWS. I’ve gone back and forth on my workflow and wanted to put together a Serverless Rust Developer Experience article. As you begin with Rust and Serverless, this should give you some good places to get started.

CategoriesServerless

Cognito Starter Kit with Rust and Lambda

Welcome to the Cognito Starter Kit with a large helping of Rust seasoned with some CDK. I’m a big believer in Cognito and the power it gives builders to customize the various signup and authentication workflows. With Cognito, you get a managed service that has flexible usage-based pricing, numerous hooks and configurations and the ability to use OAuth and OIDC in your workflows. Let’s dig in on the Cognito starter kit.

CategoriesServerless

Rust and Lambda Performance

I made a statement on LinkedIn that if you have enough traffic hitting your Lambdas you might want to consider a different programming language. And if you’ve been reading my content lately, you won’t be surprised that I suggested Rust as that alternative. Some great conversation and questions ensued with one of them suggesting that it would be less elbow grease to stand up Kubernetes with some pods than to improve performance on Lambda. The number thrown out was 250ms at the p75 mark. Fortunately, I had just the workload to test this out. Yes, I already know the answer and you should too at this point. But let’s dig in to Rust and Lambda Performance.

CategoriesServerless

Leveraging the SDK to Publish an Event to EventBridge with Lambda and Rust

Following up on my popular Rust and Lambda article, I wanted to explore how to put an event on an AWS EventBridge Bus. If you aren’t familiar with AWS’ EventBridge, think of it as a highly scalable Event Router with built-in scheduling and data transformation. Let’s take a deeper look at putting events on EventBridge with Lambda and Rust.

CategoriesProgramming

How to Build with Rust and Lambda

Rust and Lambda are new friends. Sure, there’s a great deal of momentum lately around Rust but the language has been around for almost 20 years. It struggled to take off early on but has seen its adoption increase since the creation of the Rust Foundation in 2021

AWS among many others has adopted the language for mission-critical workloads that require blazing fast performance, type-safety and solid developer experience. AWS believes so much in the language that it has built components in some of its stalwart services like S3, Cloudfront, EC2 and Lambda including the microVM technology Firecracker.

I’ve been working with Rust for the better part of 6 months which gives me just enough experience to highlight the things I like and have struggled with when building Lambdas. I believe that if you can get over the hurdle of learning Rust, you’ll gain some amazing benefits that outweigh the challenges of “getting started”. Building Lambdas with Rust.

CategoriesServerless

Customize a Cognito Access Token with Rust

Identity and Access Management is a critical part of any application. And having a solution that provides customization can also be super important. Take for instance the ability to customize a Cognito Access token to extend functionality.

So many times developers and architects try and roll their own solution and while they do their best to meet OAuth and OIDC specifications, they just tend to fall short. Not to mention they end up with more maintenance and scaling issues than they planned. By leveraging a Serverless Identity Platform like Cognito, developers and architects gain a piece that takes care of the heavy lifting of identity and access for a user base of 1 to essentially as many as needed.

However, until very recently a gap in functionality that honestly allowed some insecure usage existed. Developers were using ID tokens as Access tokens because only those tokens could be customized within a Cognito sign-in workflow. That is no longer the case, as Access tokens can now be customized. I want to take a look at how to customize a Cognito Access Token with Rust.

AWS’ Cognito allows you to implement frictionless customer identity and access management that scales

AWS