mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
feat(Config Schema): Async invocations AWS functions[] schema (#8385)
This commit is contained in:
parent
9303d8ecd4
commit
719fa3a3bf
@ -69,7 +69,7 @@ class ConfigSchemaHandler {
|
||||
validateConfig(userConfig) {
|
||||
if (this.serverless.service.provider.name === 'aws') {
|
||||
// TODO: Remove after provider is fully covered, see https://github.com/serverless/serverless/issues/8022
|
||||
this.serverless.configSchemaHandler.relaxProviderSchema();
|
||||
this.serverless.configSchemaHandler.relaxAwsProviderSchema();
|
||||
}
|
||||
|
||||
if (!this.schema.properties.provider.properties.name) {
|
||||
@ -221,6 +221,25 @@ class ConfigSchemaHandler {
|
||||
});
|
||||
}
|
||||
|
||||
relaxAwsProviderSchema() {
|
||||
// provider
|
||||
this.schema.properties.provider.additionalProperties = true;
|
||||
|
||||
// functions[].events[]
|
||||
if (
|
||||
Array.isArray(
|
||||
this.schema.properties.functions.patternProperties[FUNCTION_NAME_PATTERN].properties.events
|
||||
.items.anyOf
|
||||
) &&
|
||||
this.schema.properties.functions.patternProperties[FUNCTION_NAME_PATTERN].properties.events
|
||||
.items.anyOf.length === 1
|
||||
) {
|
||||
this.schema.properties.functions.patternProperties[
|
||||
FUNCTION_NAME_PATTERN
|
||||
].properties.events.items = {};
|
||||
}
|
||||
}
|
||||
|
||||
relaxProviderSchema() {
|
||||
// provider
|
||||
this.schema.properties.provider.additionalProperties = true;
|
||||
|
||||
@ -671,6 +671,14 @@ class AwsProvider {
|
||||
condition: { $ref: '#/definitions/awsResourceCondition' },
|
||||
dependsOn: { $ref: '#/definitions/awsResourceDependsOn' },
|
||||
description: { type: 'string', maxLength: 256 },
|
||||
destinations: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
onSuccess: { type: 'string', minLength: 1 },
|
||||
onFailure: { type: 'string', minLength: 1 },
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
disableLogs: { type: 'boolean' },
|
||||
environment: { $ref: '#/definitions/awsLambdaEnvironment' },
|
||||
fileSystemConfig: {
|
||||
@ -696,6 +704,8 @@ class AwsProvider {
|
||||
handler: { type: 'string' },
|
||||
kmsKeyArn: { $ref: '#/definitions/awsKmsArn' },
|
||||
layers: { $ref: '#/definitions/awsLambdaLayers' },
|
||||
maximumEventAge: { type: 'integer', minimum: 60, maximum: 21600 },
|
||||
maximumRetryAttempts: { type: 'integer', minimum: 0, maximum: 2 },
|
||||
memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
|
||||
onError: {
|
||||
oneOf: [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user