Andres Moreno Profile Pictrue

Andres Moreno

I'm Andres Moreno, Principal Software Engineer at Tyler Technologies. I focus on serverless techonology in AWS

Secure API Gateway with Amazon Cognito using SAM

Getting basic authentication for your API is not as hard as it sounds. In this post we'll be going through the steps to secure your APIs with Amazon Cognito

8-Minute Read

I create a lot of APIs, these are for blog posts, for playing around with new functionality or tools that I’ve created for myself. All of these have been created without authentication in place. Not securing APIs can create data exposures for you, but it can also pose a financial risk to your accounts if a malicious user gets your endpoints. This is why I want to secure any API I create but I want this to be with minimal setup so that it’s simple to replicate many times.

Using YAML anchors and aliases in a SAM template

Learn how you can setup your SAM template to reuse common pieces of config by using anchors and aliases without introducing any problems.

5-Minute Read

Image of me looking at a big text that says 'YAML Anchors in SAM

Last month I wrote a post about getting rid of Lambda Layers by using ESBuild. What I quickly learned is that the Metadata attribute has to be copied and pasted for EVERY Lambda function in your stack. I tried using the Global section in the SAM template and it turns out it’s not supported. I started thinking about how I could reuse the same configuration across my template and found that YAML already has a functionality that does this called YAML Anchors and Aliases. In this post I will…

Drop the layers, bundle up with ESBuild instead

Learn how you can structure your serverless projects to share code between Lambda Functions using ESBuild instead of Lambda Layers.

5-Minute Read

Image of a person removing a jacket into a stack of other jackets the person has already removed

I’ve seen a lot of posts around the problems that Lambda Layers bring. A very good one is called You shouldn’t use Lambda Layers by AJ Stuyvenberg. In this post AJ explains the myths and cons of using Lambda Layers. What is not easy to find is examples on how to actually get rid of Lambda Layers by using a bundler. In this post we will go through a structure and configuration that allows us to remove Layers by using ESBuild to bundle the dependencies and shared code for our…

How to update Lambda Functions from Common JS to ECMAScript

Follow these 3 steps to update your Common JS Lambda Functions to ECMAScript Modules (ESM)

2-Minute Read

Cartoon image of a laptop with gears and a person with a big wrench

Version 5.0.0 of the @middy/core package no longer supports Common JS in favor of ECMAScript Modules (ESM). ESM improves performance by 2X as mentioned in this post. Seeing this change prompted me to investigate what needs to be updated to get Lambda functions to be ESM to not fall behind on my dependency versions. In this post, we’ll go through the 3 steps needed to go from Common JS to ESM.

Recent Posts