Using AWS SAM custom build method to optimise Lambda builds in a monorepo setup
- Finn Andersen
- Jan 29
- 1 min read

The major project I've helped build at KrakenFlex involves multiple Lambdas which share common code and need to be deployed atomically. The default AWS SAM build method causes each Lambda to contain the source code for all others, which means each one gets updated for every code change.
This isn't ideal, so I've put together a basic POC project template to demonstrate how to use a custom build method to make sure each Lambda only gets the code it needs.
Hopefully this helps someone else with a similar setup!
Check it out here: https://github.com/Finndersen/aws_sam_custom_build_method
Comentários