@@ -62,38 +62,34 @@ class ServerlessLambdaEdgePreExistingCloudFront {
62
62
}
63
63
}
64
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
65
+ if ( this . serverless . configSchemaHandler ) {
66
+ this . serverless . configSchemaHandler . defineCustomProperties ( {
67
+ type : 'object' ,
68
+ properties : {
69
+ lambdaEdgePreExistingCloudFront : {
70
+ type : 'object' ,
71
+ properties : {
72
+ validStages : {
73
+ type : 'array' ,
74
+ items : { type : 'string' } ,
75
+ uniqueItems : true
76
+ }
75
77
}
76
78
}
79
+ }
80
+ } )
81
+
82
+ this . serverless . configSchemaHandler . defineFunctionEvent ( 'aws' , 'preExistingCloudFront' , {
83
+ type : 'object' ,
84
+ properties : {
85
+ distributionId : { type : 'string' } ,
86
+ eventType : { type : 'string' } ,
87
+ pathPattern : { type : 'string' } ,
88
+ includeBody : { type : 'boolean' }
77
89
} ,
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
-
90
+ required : [ 'distributionId' , 'eventType' , 'pathPattern' , 'includeBody' ]
91
+ } )
92
+ }
97
93
}
98
94
99
95
checkAllowedDeployStage ( ) {
@@ -162,7 +158,6 @@ class ServerlessLambdaEdgePreExistingCloudFront {
162
158
} )
163
159
return arn
164
160
}
165
-
166
161
}
167
162
168
163
module . exports = ServerlessLambdaEdgePreExistingCloudFront
0 commit comments