diff --git a/README.md b/README.md index 6032725a..691580a9 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ functions: hello: handler: handler.hello layers: - - Ref: PythonRequirementsLambdaLayer + - ${cf:-${self:provider.stage}.PythonRequirementsLambdaLayerQualifiedArn} ``` If the layer requires additional or custom configuration, add them onto the `layer` option. @@ -289,6 +289,7 @@ custom: licenseInfo: GPLv3 allowedAccounts: - '*' + retain: false ``` ## Omitting Packages diff --git a/lib/layer.js b/lib/layer.js index 6fe9ca4c..23082829 100644 --- a/lib/layer.js +++ b/lib/layer.js @@ -74,6 +74,10 @@ function createLayers() { description: 'Python requirements generated by serverless-python-requirements.', compatibleRuntimes: [this.serverless.service.provider.runtime], + retain: + this.options.layer.retain !== undefined && this.options.layer.retain + ? true + : false, }, this.options.layer );