(aws-elasticloadbalancingv2): AlbTarget does not accept an instance of IApplicationLoadBalancer #27466
Labels
@aws-cdk/aws-elasticloadbalancingv2
Related to Amazon Elastic Load Balancing V2
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
good first issue
Related to contributions. See CONTRIBUTING.md
p1
Describe the bug
AlbTarget
does not accept an instance ofIApplicationLoadBalancer
. This prevents it from being used alongsideApplicationLoadBalancer.fromLookup
andApplicationLoadBalancer.fromApplicationLoadBalancerAttributes
because of their return type.Workaround is to use
AlbArnTarget
directly.Expected Behavior
No compilation error.
Current Behavior
Compilation error
error TS2345: Argument of type 'IApplicationLoadBalancer' is not assignable to parameter of type 'ApplicationLoadBalancer'.
Reproduction Steps
Possible Solution
Constructor for
AlbTarget
can be changed to accept interfaceIApplicationLoadBalancer
. The implementation only referencesloadBalancerArn
from the given object, which is available in the interface too.Additional Information/Context
No response
CDK CLI Version
2.100.0 (build e1b5c77)
Framework Version
No response
Node.js Version
v18.18.0
OS
Windows 10 22H2, WSL (5.15.90.1-microsoft-standard-WSL2)
Language
TypeScript
Language Version
5.2.2
Other information
No response
The text was updated successfully, but these errors were encountered: