File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,39 @@ class ServerlessLambdaEdgePreExistingCloudFront {
61
61
} , Promise . resolve ( ) )
62
62
}
63
63
}
64
+
65
+ this . serverless . configSchemaHandler . defineCustomProperties ( {
66
+ type : 'object' ,
67
+ properties : {
68
+ lambdaEdgePreExistingCloudFront : {
69
+ type : 'object' ,
70
+ properties : {
71
+ validStages : {
72
+ type : 'array' ,
73
+ items : { type : 'string' } ,
74
+ uniqueItems : true
75
+ }
76
+ }
77
+ } ,
78
+ }
79
+ } )
80
+
81
+ this . serverless . configSchemaHandler . defineFunctionEvent ( 'aws' , 'preExistingCloudFront' , {
82
+ type : 'object' ,
83
+ properties : {
84
+ distributionId : { type : 'string' } ,
85
+ eventType : { type : 'string' } ,
86
+ pathPattern : { type : 'string' } ,
87
+ includeBody : { type : 'boolean' }
88
+ } ,
89
+ required : [
90
+ 'distributionId' ,
91
+ 'eventType' ,
92
+ 'pathPattern' ,
93
+ 'includeBody'
94
+ ]
95
+ } )
96
+
64
97
}
65
98
66
99
checkAllowedDeployStage ( ) {
@@ -121,14 +154,15 @@ class ServerlessLambdaEdgePreExistingCloudFront {
121
154
const versions = await this . provider . request ( 'Lambda' , 'listVersionsByFunction' , args )
122
155
123
156
if ( versions . NextMarker !== null ) {
124
- return await this . getlatestVersion ( functionName , versions . NextMarker )
157
+ return await this . getlatestVersionLambdaArn ( functionName , versions . NextMarker )
125
158
}
126
159
let arn
127
160
versions . Versions . forEach ( async ( functionObj ) => {
128
161
arn = functionObj . FunctionArn
129
162
} )
130
163
return arn
131
164
}
165
+
132
166
}
133
167
134
168
module . exports = ServerlessLambdaEdgePreExistingCloudFront
You can’t perform that action at this time.
0 commit comments