private createVPC()

in netbench-cdk/lib/netbench.ts [55:79]


    private createVPC() {
        // Creating VPC for clients and servers
        const vpc = new cdk.aws_ec2.Vpc(this, 'vpc', {
            ipAddresses: cdk.aws_ec2.IpAddresses.cidr(this.config.VpcCidr),
            maxAzs: this.config.VpcMaxAzs,
            subnetConfiguration: [
                {
                    cidrMask: this.config.VpcCidrMask,
                    name: 'NetbenchRunnerSubnet',
                    subnetType: cdk.aws_ec2.SubnetType.PUBLIC,
                }
            ],

        });

        //Tag all available subnets the same. This behavior might need to change when MultiRegion is added.
        const subnetTagKey = "aws-cdk:netbench-subnet-name";
        const subnetTagValue = "public-subnet-for-netbench-runners";
        vpc.publicSubnets.forEach(element => {
            cdk.Tags.of(element).add(subnetTagKey, subnetTagValue);
        });
        new cdk.CfnOutput(this, "output:NetbenchSubnetTagKey", { value: subnetTagKey });
        new cdk.CfnOutput(this, "output:NetbenchSubnetTagValue", { value: subnetTagValue });
        new cdk.CfnOutput(this, "output:" + this.stackName + "Region", { value: this.region });
    };