Check out my new course Learn you some Lambda best practice for great good! and learn the best practices for performance, cost, security, resilience, observability and scalability.
Hi, welcome to another weekly update!
Let’s welcome back Blue Matador as this month’s sponsor!
Blue Matador is monitoring alert automation for AWS and Kubernetes environments. Our proactive alerts take the time and toil out of monitoring. Trying to understand baselines and thresholds, and configuring alerts, especially in black boxes like Lambda and K8s, requires significant time and effort. Unlike all the other monitoring tools on the market, Blue Matador eliminates the need to manually configure alerts. After a quick and easy setup, Blue Matador instantly discovers all of your resources, automatically creates hundreds of alerts out-of-the-box and proactively notifies you of critical production issues. We’re so confident you’ll love Blue Matador we’re offering $100 to demo it with our team.
Why you should use temporary stacks when you do serverless. Take advantage of the pay-per-use pricing serverless gives you and create CloudFormation stacks when you’re working on feature branches. You should also consider using temporary stacks when running end-to-end tests on the CI/CD pipeline. We discussed why using temporary stack helps in these situations and some of the tradeoffs to keep in mind.
How to include SNS and Kinesis in your e2e tests. A lot of serverless architectures are heavily event-driven and often utilize SNS topics and Kinesis streams. It’s a good way to build resilient, loosely-coupled systems. But it’s also difficult to include SNS and Kinesis in end-to-end tests. In this post, I outlined several approaches for including SNS and Kinesis in your end-to-end tests.
The best reason to use DynamoDB Streams is…. When should you use DynamoDB Streams instead of Kinesis? In this post, I outline the main differences between the two services and explain what I believe is the best reason for using DynamoDB Streams over Kinesis.
Top 10 Serverless best practices. In this post, I shared my top 10 best practices for working with the Serverless framework.
Step Functions supports dynamic parallelism via the new Map state. This has been one of the most requested features for Step Functions and I’m really glad to see it finally shipped! I have updated the asl-validator and the serverless-step-functions plugin to support this new feature.
Since AWS announced the rollout of the long-await VPC improvement for Lambda, they have completed the rollout to the Frankfurt, Ohio and Tokyo regions. If you’re operating in those regions then there’s on more VPC-related cold starts for your Lambda functions!
Open source updates
NEW! Lumigo CLI
I published a new CLI to help you with your serverless development! It consists of a collection of helper commands for things that I have struggled with myself. For now, you can:
- analyze Lambda costs in all regions
- list functions in all regions and see when they’re last active
- tail events going into SNS/SQS/Kinesis
- replay SQS DLQ events
- delete CloudFormation stacks generated by Serverless framework, by name (without having to check out the code)
You can install it via NPM here. Please try it out and let me know what you think. I have big plans for it and want to add more advanced features soon, such as auto-tuning functions and measuring cold start performance, etc. If you have ideas for features then please let me know here.
NEW! A SAR app to auto-generate CloudWatch alarms!
I published a new SAR app called cloudwatch-alarms-macro to make it easy for you to create CloudWatch Alarms based on existing conventions.
This SAR app deploys a CloudFormation macro that can be used to auto-generate CloudWatch alarms for you. The macro does so based on the resources you have in a CloudFormation template and a pair of configurations you provide – one for region-wide defaults, and another for template-level overrides.
For now, the macro supports the following resources:
- Lambda: generates alarms for error rate, throttle count, DLQ error count and iterator age.
- SQS: generates an alarm for approximate message age so you know when you’re falling behind.
- API Gateway: generates alarms such as p90/p95/p99 latency, 4xx/5xx rate and 2xx rate.
- Step Functions: generates alarms for failed, throttled and timed out count.
I added support for the new Map state, so the plugin will generate the correct IAM permissions when you use the new Map state. Any functions you reference in the Iterator would be covered by the generated IAM role.
I specialise in rapidly transitioning teams to serverless and building production-ready services on AWS.
Are you struggling with serverless or need guidance on best practices? Do you want someone to review your architecture and help you avoid costly mistakes down the line? Whatever the case, I’m here to help.
Check out my new course, Learn you some Lambda best practice for great good! In this course, you will learn best practices for working with AWS Lambda in terms of performance, cost, security, scalability, resilience and observability. Enrol now and enjoy a special preorder price of £9.99 (~$13).
Are you working with Serverless and looking for expert training to level-up your skills? Or are you looking for a solid foundation to start from? Look no further, register for my Production-Ready Serverless workshop to learn how to build production-grade Serverless applications!
Here is a complete list of all my posts on serverless and AWS Lambda. In the meantime, here are a few of my most popular blog posts.
- Lambda optimization tip – enable HTTP keep-alive
- You are thinking about serverless costs all wrong
- Many faced threats to Serverless security
- We can do better than percentile latencies
- I’m afraid you’re thinking about AWS Lambda cold starts all wrong
- Yubl’s road to Serverless
- AWS Lambda – should you have few monolithic functions or many single-purposed functions?
- AWS Lambda – compare coldstart time with different languages, memory and code sizes
- Guys, we’re doing pagination wrong