Skip to content

Commit e8ecb9f

Browse files
author
Jeff Washer
committed
Add ConfigSchema to satisfy schema validation serverless 1.79.0
1 parent 3a081ed commit e8ecb9f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

index.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,39 @@ class ServerlessLambdaEdgePreExistingCloudFront {
6161
}, Promise.resolve())
6262
}
6363
}
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+
6497
}
6598

6699
checkAllowedDeployStage() {
@@ -129,6 +162,7 @@ class ServerlessLambdaEdgePreExistingCloudFront {
129162
})
130163
return arn
131164
}
165+
132166
}
133167

134168
module.exports = ServerlessLambdaEdgePreExistingCloudFront

0 commit comments

Comments
 (0)