A curious use-case came up to me this week. We have a REST API in AWS API Gateway that integrates with a Lambda. This is set up using Serverless. This is a multi-tenant system and because a former client didn’t do their cleanup, we’re still receiving a lot of calls that basically return errors (because the tenant no longer exists on our side). In AWS Lambda, this means a lot of useless invocations and a higher bill at the end

AWS CloudWatch allows you to raise alarms when certain values are above or below a given threshold. But what if you want the alarm only when it is between certain thresholds? That’s where metric math comes in. A Simple Alarm In CloudFormation, you can define an alarm quite easily: This will raise an alarm when the amount of requests per minute to the given API goes over (or is equal to) 5000. What if you want this alarm, but a

At a current client, we’re looking to move (most of) our AWS Lambda functions to NestJS. The company has built up an extensive collection of Lambda functions and it’s time to bring some structure and similarity in them. But NestJS is geared towards incoming HTTP calls. This is fine if your Lambda function is behind an API Gateway, but is it possible to use NestJS if your Lambda function should be triggered by SNS events? Uniformity? Those who know me,

I recently had to provide some numbers on AWS Lambda cold starts. These aren’t readily available in the AWS console. In fact, I couldn’t find a way anywhere online. There are lots of articles about AWS Lambda cold starts, how to avoid them, but none on how to measure them (without code changes). Here’s at least one way you can list the amount and duration of your cold starts. What Is a Cold Start? AWS Lambda functions are (intended to