Yan Cui
I help clients go faster for less using serverless technologies.
re:Invent is almost upon us. Judging by the things that had been announced ahead of re:Invent, one can’t help but be excited about the main event itself!
Here is a list of the serverless-related announcements so far that you should know about.
Payload-based message filtering for Amazon SNS
Here’s the official announcement.
This is arguably the biggest preinvent announcement!
Payload-based filtering was one of the key reasons why you would choose EventBridge over SNS. This new feature makes SNS a much more viable option in an Event-Driven Architecture.
Off the top of my head, this would:
1. Allow you to use one SNS topic for many types of messages, previously one tends to have many SNS topics
2. Reduce the coupling between publisher and consumer teams. There’s no need to pester the publisher team to add a message attribute so you can filter their messages.
3. It makes message filtering easier when you’re not limited to what’s in the message attributes (and you can only have 10!)
To be clear, there are still many reasons to choose EventBridge over SNS. For example, EventBridge has built-in event archive, replay, schema discovery, cross-account delivery to another bus and supports many more targets. But for really simple use cases, SNS is now a more viable option. And not to mention, it has FIFO support, which EventBridge doesn’t. So in some cases, it might even be a better option than EventBridge.
Also, as Nik pointed out. EventBridge and SNS are built for different use cases and SNS is better for cases where you need to fan-out to a large number of subscribers.
AppSync now supports JavaScript resolvers
Here’s the official announcement.
This is the news that I have been waiting for for a long time, ever since the AppSync team published the RFC way back in 2021. Now it’s finally here!
One thing to note is that this applies to AppSync pipeline resolvers only. I hope unit resolvers would support JavaScript in the future as well because most of my resolvers today are unit resolvers.
Nonetheless, this is a massive step forward and it’s easily the most requested feature from the AppSync community. And I for one, am excited and can’t wait to try it out.
The EventBridge Scheduler is here
Here’s the official announcement.
You can now schedule one-off, ad-hoc events at scale using the new EventBridge Scheduler service. This is one of the long-standing gaps in AWS (alongside a serverless search service) and I’ve had to build this type of system several times in the past.
I’m glad that this didn’t come out when I was writing my last book though. It would have rendered the entire chapter 7 moot! But I guess that chapter now serves as a useful mental exercise for “what would you do if you had to build a system like this yourself?”
This is a big feature update, and I’m glad it’s finally here! I’ve wanted something like this for many years.
My only nitpick with this new service is that it’s only granular to the minute. This is a nitpick because, for most use cases, this is not an issue.
However, I’ve had use cases where a scheduled event needs to fire within a second and therefore needs better precision. For example, when you start a fixed-time, multi-player match when X players join, you want to schedule the end of the match to tally the scores and work out the winner.
Lambda supports a new Telemetry API
Here’s my coverage of this new feature.
Back in 2020, I covered the launch of Lambda Extensions and the subsequent release of the Lambda Logs API. These features aren’t designed for the average Lambda user. But they allow vendors to build better tools by giving them much-needed access to the Lambda execution environment.
The new Telemetry API supersedes the Logs API and allows the extensions to subscribe and receive telemetry data about the Lambda function, including:
- function logs
- extension logs
- events (e.g.
INIT
,INVOKE
andSHUTDOWN
) - metrics
- traces*
(* The traces are emitted by the Lambda service and does not follow the X-Ray trace segment structure.)
With the new Telemetry API, we should see better support from third-party vendors for observing what’s going on in our serverless applications.
Lambda supports AOT compilation for .Net functions
Here’s the official announcement.
This is an important update for anyone running .Net in Lambda.
It enables .Net’s native AOT (ahead-of-time) compilation, which compiles .Net application to native code and removes the need for JIT (just-in-time) compilation.
This makes cold starts much faster for .Net applications. According to the numbers published in this repo, it puts cold start time for .Net applications on par with Javascript and Python.
EventBridge supports enhanced filtering
Here’s the official announcement.
You now have a bunch more options for filtering events, including suffix filtering, case-insensitive matching, and using OR to match across multiple fields.
The big one for me is suffix filtering, which comes in very handy for S3 events. It lets you filter events by file extensions. This is something that I had needed a couple of times in the past and I was forced to use an S3 notification to trigger a Lambda function instead of going straight to EventBridge. I’m glad that this workaround is no longer necessary!
SecretsManager can now rotate secrets every four hours
Here’s the official announcement.
This is a notable improvement from the previous “everyday” frequency. However, I still don’t find myself using SecretsManager as much as SSM Parameter Store.
The built-in rotation is useful when you’re using things like RDS and DocumentDB services. But for custom secrets, you have to write a custom Lambda function, which needs to expose specific handler functions. It takes more work and has no obvious benefits over doing the same with a simple cron Lambda and SSM Parameter Store, which allows you to rotate as often as every minute.
SecretsManager is also more expensive relatively speaking. At $0.10 per secret per month, the cost can add up when you multiply the no. of secrets by the no. of AWS accounts (especially when you have one account per dev/team).
Where SecretsManager shines is the fact that it has built-in replication to other regions. This is very handy when you have a multi-region setup. In this case, the extra cost is totally worth it.
It also has a higher throughput limit (10k ops/s) compared to SSM Parameter Store (1k ops/s). But when you’re using multiple AWS accounts and have basic caching (which you absolutely should!) I think 1k ops/s should be enough for most use cases.
Bring on re:Invent 2022!
OK, so that’s a list of the biggest serverless-related announcements that we’ve had in the last month or so leading up to re:Invent 2022.
Unfortunately, I won’t be at the event this year, but I’ll be keeping a close eye on it like most of you. And I will update the contents for my upcoming Production-Ready Serverless workshop to cover the relevant changes from re:Invent.
If you want to learn how to build production-ready serverless applications then now’s the best time to sign up for the workshop.
I’m running a special promotion to celebrate the launch of my new course “Testing Serverless Architectures”. Where you can get “Testing Serverless Architectures” for FREE when you sign up for “Production-Ready Serverless”. That represents a huge saving of $300!
Hurry, space is limited and the offer expires on 1st January 2023.
Join me in going faster for less by successfully adopting serverless.
Whenever you’re ready, here are 3 ways I can help you:
- Production-Ready Serverless: Join 20+ AWS Heroes & Community Builders and 1000+ other students in levelling up your serverless game. This is your one-stop shop for quickly levelling up your serverless skills.
- I help clients launch product ideas, improve their development processes and upskill their teams. If you’d like to work together, then let’s get in touch.
- Join my community on Discord, ask questions, and join the discussion on all things AWS and Serverless.