From 34aef937b7414a421e3af5465a001a21d0368520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barthelet?= Date: Sun, 20 Sep 2020 15:12:48 +0200 Subject: [PATCH] Add package, condition and dependsOn property --- lib/plugins/aws/provider/awsProvider.js | 37 +++++++++++++++++-------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/lib/plugins/aws/provider/awsProvider.js b/lib/plugins/aws/provider/awsProvider.js index f9a68312903e..41aa43e2691d 100644 --- a/lib/plugins/aws/provider/awsProvider.js +++ b/lib/plugins/aws/provider/awsProvider.js @@ -222,11 +222,6 @@ class AwsProvider { required: ['Fn::Sub'], additionalProperties: false, }, - awsLambdaLayers: { - type: 'array', - items: { $ref: '#/definitions/awsArn' }, - }, - awsLambdaMemorySize: { type: 'integer', multipleOf: 64, minimum: 128, maximum: 3008 }, awsLambdaEnvironment: { type: 'object', patternProperties: { @@ -240,6 +235,21 @@ class AwsProvider { }, additionalProperties: false, }, + awsLambdaLayers: { + type: 'array', + items: { $ref: '#/definitions/awsArn' }, + }, + awsLambdaMemorySize: { type: 'integer', multipleOf: 64, minimum: 128, maximum: 3008 }, + awsLambdaPackage: { + type: 'object', + properties: { + include: { type: 'array', items: { type: 'string' } }, + exclude: { type: 'array', items: { type: 'string' } }, + excludeDevDependencies: { type: 'boolean' }, + artifact: { type: 'string' }, + individually: { type: 'boolean' }, + }, + }, awsLambdaRole: { anyOf: [ { type: 'string', minLength: 1 }, @@ -289,17 +299,19 @@ class AwsProvider { }, }, }, + awsResourceCondition: { type: 'string' }, + awsResourceDependsOn: { + oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }], + }, awsResourceProperties: { Properties: { type: 'object' }, CreationPolicy: { type: 'object' }, DeletionPolicy: { type: 'string' }, - DependsOn: { - oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }], - }, + DependsOn: { $ref: '#/definitions/awsResourceDependsOn' }, Metadata: { type: 'object' }, UpdatePolicy: { type: 'object' }, UpdateReplacePolicy: { type: 'string' }, - Condition: { type: 'string' }, + Condition: { $ref: '#/definitions/awsResourceCondition' }, }, awsResourceTags: { type: 'object', @@ -410,6 +422,7 @@ class AwsProvider { }, }, memorySize: { $ref: '#/definitions/awsLambdaMemorySize' }, + package: { $ref: '#/definitions/awsLambdaPackage' }, resourcePolicy: { type: 'array', items: { @@ -442,8 +455,8 @@ class AwsProvider { { $ref: '#/definitions/awsCfFunction' }, ], }, - condition: {}, - dependsOn: {}, + condition: { $ref: '#/definitions/awsResourceCondition' }, + dependsOn: { $ref: '#/definitions/awsResourceDependsOn' }, description: { type: 'string', maxLength: 256 }, disableLogs: { type: 'boolean' }, environment: { $ref: '#/definitions/awsLambdaEnvironment' }, @@ -476,7 +489,7 @@ class AwsProvider { { $ref: '#/definitions/awsCfFunction' }, ], }, - package: {}, + package: { $ref: '#/definitions/awsLambdaPackage' }, provisionedConcurrency: { type: 'integer', minimum: 1 }, reservedConcurrency: { type: 'integer', minimum: 0 }, role: { $ref: '#/definitions/awsLambdaRole' },