@aws-cdk/aws-elasticloadbalancingv2
has various from*
lookup methods, but I don't see anything like that over in @aws-cdk/aws-elasticloadbalancing
. Am I just missing it, or is this really a missing feature?
Thanks!
Edit: For the record, it sounds like this is an unsupported feature. I've filed https://github.com/aws/aws-cdk/issues/18141 upstream to hopefully get this implemented.
It is a missing feature.
Other tools like Pulumi (based on Terraform) have been able to do it via the ARN of the CLB.
Terraform itself can do it via the name of the CLB.
The docs should be similar across the board but just to double-check this, the CDK API docs for ELB v2 show that you can lookup application load balancers (ALBs) and network load balancers (NLBs) as you've mentioned.
Similarly (to cross out possible language-specific CDK implementations), I looked through the entire CDK API docs for ELB v1 which refers to classic load balancers (CLBs). There are no lookup methods.
Considering Terraform has done this, it means that there must be an AWS API for it - perhaps try seeing if you can use AwsSdkCall
to make a custom call and obtain the data needed.