Skip to content
  • Aaron Beckett's avatar
    Restructure layer code dirs to support proper layer namespacing · b8fb51f5
    Aaron Beckett authored
    Layer assets are zipped and uploaded by directory.
    Layers are unzipped in the /opt dir of Lambda environment.
    To properly scope layers, using following structure:
    
    src
     |_ layers
       |_ <layer name>
         |_ nodejs
           |_ <layer name>
             |_ index.ts
             |_ package.json
             |_ ...
    
    This will allow individual layers to be zipped by referencing the
    src/layers/<layer name> when creating layer assets.
    
    It will also allow lambda function code to reference layers as packages
    scoped to their runtime and prevent filename conflicts when unzipping in /opt:
    
    import * from '/opt/nodejs/<layer name>'
    b8fb51f5