aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.65k stars 3.91k forks source link

ec2.Instance should implement elbv2.IApplicationLoadBalancerTarget, elbv2.INetworkLoadBalancerTarget #4180

Closed swapnil-jak closed 5 years ago

swapnil-jak commented 5 years ago

Similar to an AutoScaling Group, I should be able to add 1/more EC2 Instance/s as the target of an ALB/NLB target group.

Only classes implementing IApplicationLoadBalancerTarget can be added as a target of ALB Target Groups.

Use Case

This is a very common use-case for applications which support clustering but don't support scale-out/scale-in. Especially software products whose license is bound to the system MAC.

Proposed Solution

ec2.Instance should implement elbv2.IApplicationLoadBalancerTarget, elbv2.INetworkLoadBalancerTarget

Other


This is a :rocket: Feature Request

rix0rrr commented 5 years ago

Recently implemented by @hoegertn in the way of an InstanceTarget. Unfortunately cyclic dependencies make it impossible for Instance to implement the required interfaces.