File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ const defaults = {
41
41
handler : 'handler.hello' ,
42
42
runtime : 'nodejs10.x' ,
43
43
env : { } ,
44
- region : 'us-east-1'
44
+ region : 'us-east-1' ,
45
+ layers : [ ]
45
46
}
46
47
47
48
class AwsLambda extends Component {
Original file line number Diff line number Diff line change
1
+ /* eslint-disable prettier/prettier */
1
2
const { tmpdir } = require ( 'os' )
2
3
const path = require ( 'path' )
3
4
const archiver = require ( 'archiver' )
@@ -76,7 +77,8 @@ const createLambda = async ({
76
77
zipPath,
77
78
bucket,
78
79
role,
79
- layer
80
+ layer, // From autogenerated layer
81
+ layers // Manual layers
80
82
} ) => {
81
83
const params = {
82
84
FunctionName : name ,
@@ -90,11 +92,13 @@ const createLambda = async ({
90
92
Timeout : timeout ,
91
93
Environment : {
92
94
Variables : env
93
- }
95
+ } ,
96
+ Layers : layers
94
97
}
95
98
99
+
96
100
if ( layer && layer . arn ) {
97
- params . Layers = [ layer . arn ]
101
+ params . Layers = [ layer . arn , ... layers ]
98
102
}
99
103
100
104
if ( bucket ) {
@@ -119,7 +123,8 @@ const updateLambdaConfig = async ({
119
123
env,
120
124
description,
121
125
role,
122
- layer
126
+ layer, // From autogenerated layer
127
+ layers // Manual layers
123
128
} ) => {
124
129
const functionConfigParams = {
125
130
FunctionName : name ,
@@ -131,11 +136,12 @@ const updateLambdaConfig = async ({
131
136
Timeout : timeout ,
132
137
Environment : {
133
138
Variables : env
134
- }
139
+ } ,
140
+ Layers : layers
135
141
}
136
142
137
143
if ( layer && layer . arn ) {
138
- functionConfigParams . Layers = [ layer . arn ]
144
+ functionConfigParams . Layers = [ layer . arn , ... layers ]
139
145
}
140
146
141
147
const res = await lambda . updateFunctionConfiguration ( functionConfigParams ) . promise ( )
You can’t perform that action at this time.
0 commit comments