All project notes

Engineering

Lambda layers for shared SugarRush code

SugarRush published common code and Node.js dependencies as a versioned Lambda layer.

The SugarRush library service published a versioned Lambda layer. SugarRush Manual read that version from the layer stack output for the same stage and attached it to its functions.
Illustrative diagram

The framework can package shared files as an AWS Lambda layer that several functions can use. SugarRush deployed its common library as a separate service. SugarRush Manual read the qualified layer ARN from the CloudFormation outputs for the same stage, so that its functions could attach a specific layer version. The library’s README gives the release sequence for a dependency change. Publish the layer first, then redeploy the applications that consume it.

SalesCandy Git evidence — SugarRush/sugarrush-main-library-layer at b494aa6 (21 October 2022), README.md and layer/serverless.yml. SugarRush/manual at cb0b835 (21 October 2022), serverless.yml. AWS Lambda layers