File tree 2 files changed +17
-10
lines changed
examples/example-layer-service
2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -44,17 +44,23 @@ function getConfig(serverless) {
44
44
class LayerManagerPlugin {
45
45
constructor ( sls , options = { } ) {
46
46
this . level = options . v || options . verbose ? 'verbose' : LOG_LEVEL ;
47
- this . config = getConfig ( sls ) ;
48
47
49
48
info ( this , `Invoking layer-manager plugin` ) ;
50
- verbose ( this , `Config: ` , this . config ) ;
51
49
52
50
this . hooks = {
53
- 'package:initialize' : ( ) => this . installLayers ( sls ) ,
51
+ 'package:initialize' : ( ) => {
52
+ this . init ( sls ) ;
53
+ this . installLayers ( sls )
54
+ } ,
54
55
'before:deploy:deploy' : ( ) => this . transformLayerResources ( sls )
55
56
} ;
56
57
}
57
58
59
+ init ( sls ) {
60
+ this . config = getConfig ( sls ) ;
61
+ verbose ( this , `Config: ` , this . config ) ;
62
+ }
63
+
58
64
installLayer ( path ) {
59
65
const nodeLayerPath = `${ path } /nodejs` ;
60
66
@@ -141,4 +147,4 @@ class LayerManagerPlugin {
141
147
}
142
148
}
143
149
144
- module . exports = LayerManagerPlugin ;
150
+ module . exports = LayerManagerPlugin ;
Original file line number Diff line number Diff line change @@ -20,10 +20,11 @@ functions:
20
20
# Note the reference being the TitleCase representation of the layer id followed by "LambdaLayer"
21
21
- {Ref: MyLibLambdaLayer}
22
22
23
- # custom:
24
- # layerConfig:
25
- # installLayers: <boolean>
26
- # exportLayers: <boolean>
27
- # upgradeLayerReferences: <boolean>
28
- # exportPrefix: <prefix used for the names of the exported layers>
23
+ custom :
24
+ foo : FOO
25
+ layerConfig :
26
+ installLayers : true
27
+ exportLayers : true
28
+ upgradeLayerReferences : true
29
+ exportPrefix : ${self:service}-${self:custom.foo}- # prefix used for the names of the exported layers
29
30
You can’t perform that action at this time.
0 commit comments