feat(AWS Lambda): Recognize Fn::If for properties of vpc (#10877)

This commit is contained in:
ALOHACREPES345 2022-03-21 18:40:48 +09:00 committed by GitHub
parent 12601e7760
commit 6a86ed77f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -578,7 +578,12 @@ class AwsProvider {
anyOf: [
{
type: 'array',
items: { $ref: '#/definitions/awsCfInstruction' },
items: {
anyOf: [
{ $ref: '#/definitions/awsCfInstruction' },
{ $ref: '#/definitions/awsCfIf' },
],
},
maxItems: 5,
},
{ $ref: '#/definitions/awsCfSplit' },
@ -589,7 +594,12 @@ class AwsProvider {
anyOf: [
{
type: 'array',
items: { $ref: '#/definitions/awsCfInstruction' },
items: {
anyOf: [
{ $ref: '#/definitions/awsCfInstruction' },
{ $ref: '#/definitions/awsCfIf' },
],
},
maxItems: 16,
},
{ $ref: '#/definitions/awsCfSplit' },

View File

@ -1126,8 +1126,8 @@ describe('lib/plugins/aws/package/compile/functions/index.test.js', () => {
fnImage: { image: imageWithSha },
foo: {
vpc: {
subnetIds: ['subnet-02020202'],
securityGroupIds: ['sg-1b1b1b1b'],
subnetIds: ['subnet-02020202', { 'Fn::If': ['cond', 'first', 'second'] }],
securityGroupIds: ['sg-1b1b1b1b', { 'Fn::If': ['cond', 'first', 'second'] }],
},
kmsKeyArn: 'arn:aws:kms:region:accountid:fun/ction',
tracing: 'PassThrough',