Andres Moreno Profile Pictrue

Andres Moreno

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

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 a diagram in excalibur showing a Step Function calling a Lambda Function and the Lambda Function calling out to the Internet with the Lambda Function crossed out

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…

Speed up new serverless application development with customized SAM templates

Learn how you can use custom templates with SAM to speed up initial application setup.

3-Minute Read


As you start setting patterns and best practices within your projects at some point you will want to share these to simplify the lives of other developers.
SAM allows you to initialize projects by using the init command and selecting a template for your project. SAM has built-in templates to generate simple Hello-World starter projects (you can find the list of templates here). These will help you get started and get familiar with how to structure your serverless applications but as your…

Recent Posts