constructor()

in lib/simulated-on-prem.ts [20:44]


    constructor(scope: cdk.Construct, id: string, props: SimulatedOnPremProps = {}) {
        super(scope, id);

        this.eip = new ec2.CfnEIP(this, "onPremEIP");
        const allocationId = cdk.Fn.getAtt(this.eip.logicalId, "AllocationId");

        // Create the VPC with PUBLIC subnet
        this.vpc = new ec2.Vpc(this, props.prefix!.concat('-VPC').toString(), {
            cidr: props.cidr,
            maxAzs: 1,
            subnetConfiguration: [
                {
                    cidrMask: props.cidrMask,
                    name: props.prefix!.concat('-VPC | Public'),
                    subnetType: SubnetType.PUBLIC
                }]
        });

        // Outputs
        new CfnOutput(this, "eipAllocationId", {
            description: "EIP allocation ID",
            exportName: "eipAllocationId",
            value: allocationId.toString()
        });
    }