Lambda

Why you should use ephemeral environments when you do serverless

One of the benefits of serverless is the pay-per-use pricing model you get from the platform. That is, if your code doesn’t run, you don’t pay for them! Combined with the simplified deployment flow (compared with applications running in containers or VMs) it has enabled many teams to use ephemeral environments to simplify their workflow …

Why you should use ephemeral environments when you do serverless Read More »

How to use the power of CloudFormation custom resources for great good

Disclaimer: if you’re new to CloudFormation custom resources, then I recommend you start by reading this excellent post by Alex Debrie first. Custom resources bring a whole new dimension to CloudFormation and enable some fascinating use cases. For example: provision DataDog dashboards as part of your CloudFormation stack run a load test every time you …

How to use the power of CloudFormation custom resources for great good Read More »

A simple event-sourcing example with snapshots using Lambda and DynamoDB

Recently, I have been helping a client implement an event-sourced system. In the process, I put together a very simple demo app to illustrate how one could build such a system using Lambda and DynamoDB. The source code is available on GitHub here. Before you go ahead and read all about the demo app, I …

A simple event-sourcing example with snapshots using Lambda and DynamoDB Read More »

How to do blue-green deployment for Step Functions

A client asked me the other day: “What happens to the running executions when I update a state machine?” Sadly, the answer is likely that existing executions would break if you have changed the input/output of the Lambda functions they call. The solution is to use specific versions or aliases of the functions instead. But …

How to do blue-green deployment for Step Functions Read More »

How to make serverless framework boilerplates customizable

The Serverless framework lets you reference external JSON, YML and JS files using the syntax ${file:(fileName):propertyName}. However, you can’t customize these external config files with runtime arguments. A reader asked me: “I have this boilerplate that is repeated many times in my serverless.yml, how do I reuse the boilerplate but override only specific fields?” It’s …

How to make serverless framework boilerplates customizable Read More »

Serverless Step Functions: no more leaky abstractions

I have some exciting news to share with you about the Serverless Step Functions plugin. One of the main pain points of using the plugin was that you needed to use fully-formed ARNs. We addressed this in v1.18.0 by supporting CloudFormation intrinsic functions Fn:GetAtt and Ref. This makes it possible for you to reference a …

Serverless Step Functions: no more leaky abstractions Read More »

Introducing a better way to record custom metrics

Many clients have asked me “how do I record custom metrics from Lambda?”. Generally speaking, you can either: Publish custom metrics synchronously – e.g. send them at the end of an invocation. Publish custom metrics asynchronously by writing them to stdout first and then extracting them from CloudWatch Logs. Problems with sending custom metrics synchronously …

Introducing a better way to record custom metrics Read More »

How to connect SNS to Kinesis for cross-account delivery via API Gateway

At DAZN (where I no longer work), the teams work with a number of third-party providers. They often have to synchronize data between different AWS accounts. SNS to SQS is the primary mechanism for these cross-account deliveries because: it was an established pattern within the organization DAZN engineers and third-party engineers are both familiar with …

How to connect SNS to Kinesis for cross-account delivery via API Gateway Read More »

AWS Lambda: how to share code between functions in a monorepo

A while back, a client asked me “how can I share business logic between services in a Node.js monorepo?”. The TL;DR of it is: Encapsulate the shared business logic into modules, and put them in a separate folder. In the Lambda handler functions, reference the shared modules using relative paths. Use webpack to resolve and …

AWS Lambda: how to share code between functions in a monorepo Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close