*/ const alb = new elbv2.ApplicationLoadBalancer(this, `pj2-alb`, { vpc: vpc, internetFacing: true, securityGroup: sgEc2Alb, }); /* ---------- TargetGroup ---------- */ const tg = new elbv2.ApplicationTargetGroup(this,`pj2-tg`, { vpc: vpc, port: 80, targetType: elbv2.TargetType.INSTANCE, targets: [ new elbv2_tg.InstanceIdTarget(ec2Web01.instanceId), new elbv2_tg.InstanceIdTarget(ec2Web02.instanceId), ], }); /* ---------- Listner ---------- */ alb.addListener(`pj2-listener-443`, { port: 443, defaultTargetGroups: [tg], certificates: [cert], });