From 2fa207eacf4b136bef450b3e4efdd0ec9836051f Mon Sep 17 00:00:00 2001 From: naoyasugita Date: Sat, 11 Feb 2023 23:25:30 +0900 Subject: [PATCH 1/2] feat: Add retain to layer options --- lib/layer.js | 4 ++++ 1 file changed, 4 insertions(+) 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 ); From a0d67dbb17aff557d06e8a719caac9caa797c7cb Mon Sep 17 00:00:00 2001 From: naoyasugita Date: Sat, 11 Feb 2023 23:25:40 +0900 Subject: [PATCH 2/2] docs: Update layers sample --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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