Skip to content

Commit

Permalink
add test for empty security group array
Browse files Browse the repository at this point in the history
  • Loading branch information
DDynamic committed May 25, 2022
1 parent 2835f14 commit f007e24
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/@aws-cdk/aws-apprunner/test/vpc-connector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,40 @@ test('create a vpcConnector without a security group should create one', () => {
},
],
});
});

test('create a vpcConnector with an empty security group array should create one', () => {
// GIVEN
const app = new cdk.App();
const stack = new cdk.Stack(app, 'demo-stack');

const vpc = new ec2.Vpc(stack, 'Vpc', {
cidr: '10.0.0.0/16',
});

// WHEN
new VpcConnector(stack, 'VpcConnector', {
vpc,
vpcSubnets: vpc.selectSubnets({ subnetType: ec2.SubnetType.PUBLIC }),
securityGroups: [],
});
// THEN
Template.fromStack(stack).hasResourceProperties('AWS::AppRunner::VpcConnector', {
Subnets: [
{
Ref: 'VpcPublicSubnet1Subnet5C2D37C4',
},
{
Ref: 'VpcPublicSubnet2Subnet691E08A3',
},
],
SecurityGroups: [
{
'Fn::GetAtt': [
'VpcConnectorSecurityGroup33FAF25D',
'GroupId',
],
},
],
});
});

0 comments on commit f007e24

Please sign in to comment.