Serverless AWS Add Lambda Layer to Lambda Function

Add a Lambda Layer to your AWS Lambda Function through your Severless Yaml file.

Add the following YAML to your Serverless file.

1provider: 2 layers: 3 - { Ref: DataServiceLambdaLayer } 4 5layers: 6 DataService: 7 path: ./layer 8 compatibleRuntimes: 9 - nodejs14.x

Make sure to note that "LambaLayer" is automatically added onto your specified Lambda Layer's name.