Skip to content

Commit

Permalink
Sort awsProviders properties new keys
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericbarthelet committed Sep 16, 2020
1 parent eb844f9 commit 1397042
Showing 1 changed file with 66 additions and 68 deletions.
134 changes: 66 additions & 68 deletions lib/plugins/aws/provider/awsProvider.js
Expand Up @@ -141,14 +141,6 @@ class AwsProvider {
// TODO: Complete schema, see https://github.com/serverless/serverless/issues/8016
serverless.configSchemaHandler.defineProvider('aws', {
definitions: {
awsSnsArnString: {
type: 'string',
pattern: '^arn:aws[a-z-]*:sns',
},
awsKmsArnString: {
type: 'string',
pattern: '^arn:aws[a-z-]*:kms',
},
awsArn: {
oneOf: [
{ $ref: '#/definitions/awsArnString' },
Expand All @@ -158,20 +150,6 @@ class AwsProvider {
awsArnString: {
type: 'string',
pattern: '^arn:',
awsSnsArn: {
oneOf: [
{ $ref: '#/definitions/awsSnsArnString' },
{ $ref: '#/definitions/awsCfFunction' },
],
},
awsKmsArn: {
oneOf: [
{ $ref: '#/definitions/awsKmsArnString' },
{ $ref: '#/definitions/awsCfFunction' },
],
},
awsCfInstruction: {
oneOf: [{ type: 'string', minLength: 1 }, { $ref: '#/definitions/awsCfFunction' }],
},
awsCfFunction: {
oneOf: [
Expand Down Expand Up @@ -244,20 +222,35 @@ class AwsProvider {
required: ['Fn::Sub'],
additionalProperties: false,
},
awsResourceProperties: {
Properties: { type: 'object' },
CreationPolicy: { type: 'object' },
DeletionPolicy: { type: 'string' },
DependsOn: {
oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],
},
Metadata: { type: 'object' },
UpdatePolicy: { type: 'object' },
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
awsKmsArn: {
oneOf: [
{ $ref: '#/definitions/awsKmsArnString' },
{ $ref: '#/definitions/awsCfFunction' },
],
},
awsKmsArnString: {
type: 'string',
pattern: '^arn:aws[a-z-]*:kms',
},
awsLambdaLayers: {
type: 'array',
items: { $ref: '#/definitions/awsArn' },
},
awsLambdaMemorySize: { type: 'integer', multipleOf: 64, minimum: 128, maximum: 3008 },
awsLambdaTimeout: { type: 'integer', minimum: 1, maximum: 900 },
awsLambdaEnvironment: {
type: 'object',
patternProperties: {
'^[A-Za-z_][a-zA-Z0-9_]*$': { $ref: '#/definitions/awsCfInstruction' },
},
additionalProperties: false,
},
awsLambdaRole: {
anyOf: [
{ type: 'string', minLength: 1 },
{ $ref: '#/definitions/awsCfImport' },
{ $ref: '#/definitions/awsCfGetAtt' },
],
},
awsLambdaRuntime: {
enum: [
'dotnetcore2.1',
Expand All @@ -278,21 +271,9 @@ class AwsProvider {
'ruby2.7',
],
},
awsLambdaTimeout: { type: 'integer', minimum: 1, maximum: 900 },
awsLambdaTracing: { anyOf: [{ enum: ['Active', 'PassThrough'] }, { type: 'boolean' }] },
awsLambdaEnvironment: {
type: 'object',
patternProperties: {
'^[A-Za-z_][a-zA-Z0-9_]*$': { $ref: '#/definitions/awsCfInstruction' },
},
additionalProperties: false,
},
awsLambdaRole: {
anyOf: [
{ type: 'string', minLength: 1 },
{ $ref: '#/definitions/awsCfImport' },
{ $ref: '#/definitions/awsCfGetAtt' },
],
},
awsLambdaVersionning: { type: 'boolean' },
awsLambdaVpcConfig: {
type: 'object',
properties: {
Expand All @@ -312,11 +293,18 @@ class AwsProvider {
},
},
},
awsLambdaLayers: {
type: 'array',
items: { $ref: '#/definitions/awsArn' },
awsResourceProperties: {
Properties: { type: 'object' },
CreationPolicy: { type: 'object' },
DeletionPolicy: { type: 'string' },
DependsOn: {
oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],
},
Metadata: { type: 'object' },
UpdatePolicy: { type: 'object' },
UpdateReplacePolicy: { type: 'string' },
Condition: { type: 'string' },
},
awsLambdaVersionning: { type: 'boolean' },
awsResourceTags: {
type: 'object',
patternProperties: {
Expand All @@ -327,9 +315,20 @@ class AwsProvider {
},
additionalProperties: false,
},
awsSnsArn: {
oneOf: [
{ $ref: '#/definitions/awsSnsArnString' },
{ $ref: '#/definitions/awsCfFunction' },
],
},
awsSnsArnString: {
type: 'string',
pattern: '^arn:aws[a-z-]*:sns',
},
},
provider: {
properties: {
environment: { $ref: '#/definitions/awsLambdaEnvironment' },
httpApi: {
type: 'object',
properties: {
Expand Down Expand Up @@ -392,6 +391,7 @@ class AwsProvider {
},
additionalProperties: false,
},
layers: { $ref: '#/definitions/awsLambdaLayers' },
logs: {
type: 'object',
properties: {
Expand All @@ -409,16 +409,17 @@ class AwsProvider {
},
},
},
memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
resourcePolicy: {
type: 'array',
items: {
type: 'object',
},
},
memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
timeout: { $ref: '#/definitions/awsLambdaTimeout' },
role: { $ref: '#/definitions/awsLambdaRole' },
runtime: { $ref: '#/definitions/awsLambdaRuntime' },
tags: { $ref: '#/definitions/awsResourceTags' },
timeout: { $ref: '#/definitions/awsLambdaTimeout' },
tracing: {
type: 'object',
properties: {
Expand All @@ -427,15 +428,16 @@ class AwsProvider {
},
additionalProperties: false,
},
environment: { $ref: '#/definitions/awsLambdaEnvironment' },
role: { $ref: '#/definitions/awsLambdaRole' },
vpc: { $ref: '#/definitions/awsLambdaVpcConfig' },
layers: { $ref: '#/definitions/awsLambdaLayers' },
versionFunctions: { $ref: '#/definitions/awsLambdaVersionning' },
},
},
function: {
properties: {
awsKmsKeyArn: { $ref: '#/definitions/awsKmsArn' },
description: { type: 'string', maxLength: 256 },
disableLogs: { type: 'boolean' },
environment: { $ref: '#/definitions/awsLambdaEnvironment' },
fileSystemConfig: {
type: 'object',
properties: {
Expand All @@ -450,22 +452,18 @@ class AwsProvider {
required: ['localMountPath', 'arn'],
},
handler: { type: 'string' },
layers: { $ref: '#/definitions/awsLambdaLayers' },
memorySize: { $ref: '#/definitions/awsLambdaMemorySize' },
timeout: { $ref: '#/definitions/awsLambdaTimeout' },
onError: { $ref: '#/definitions/awsSnsArn' },
provisionedConcurrency: { type: 'integer', minimum: 0 },
reservedConcurrency: { type: 'integer', minimum: 0 },
role: { $ref: '#/definitions/awsLambdaRole' },
runtime: { $ref: '#/definitions/awsLambdaRuntime' },
description: { type: 'string', maxLength: 256 },
tags: { $ref: '#/definitions/awsResourceTags' },
onError: { $ref: '#/definitions/awsSnsArn' },
awsKmsKeyArn: { $ref: '#/definitions/awsKmsArn' },
timeout: { $ref: '#/definitions/awsLambdaTimeout' },
tracing: { $ref: '#/definitions/awsLambdaTracing' },
environment: { $ref: '#/definitions/awsLambdaEnvironment' },
role: { $ref: '#/definitions/awsLambdaRole' },
vpc: { $ref: '#/definitions/awsLambdaVpcConfig' },
reservedConcurrency: { type: 'integer', minimum: 0 },
provisionedConcurrency: { type: 'integer', minimum: 0 },
disableLogs: { type: 'boolean' },
layers: { $ref: '#/definitions/awsLambdaLayers' },
versionFunction: { $ref: '#/definitions/awsLambdaVersionning' },
vpc: { $ref: '#/definitions/awsLambdaVpcConfig' },
},
},
resources: {
Expand Down

0 comments on commit 1397042

Please sign in to comment.