I have created an EC2 instance and a Classic Load Balancer in AWS CDK using typescript. But I'm unable to add that EC2 instance directly to that Load balancer.
this.Instance= new ec2.Instance(this, 'my-Instance', {
vpc,
instanceType: new InstanceType(instanceType),
...});
and load Balancer
this.Elb = new LoadBalancer(this, 'my-ELB', {
..
crossZone: true,
internetFacing: false,
...});
I'm looking to add this ec2 instance to this load balancer using something like this:
this.Elb.addEc2Instance(this.Instance)
but there isn't any such property available.