Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some testing lead me to find that the mapping between Loadbalancer V1 and V2 was not happening correctly and in response to that, I delved into the code for the mapping.
The regex used to distinguish between V1 and V2 had the variable assignment inverted ie v1's were getting assigned to elbv2_id attribute and vice versa
Creating a dynamic dnsname and then matching for LoadbalancerV2 was problematic as well since the dynamically created names were always partial matches for the dnsname. The elb_match[2] attribute was never right to match to the correct node. (the regex returns the id of the loadbalancer while the dnsname always has a different value)
created using carto -> elb_match[1]-elb_match[2].elb.region.amazonaws.com
actual dnsname -> elb_match[1]-elb_match[2]-9574787.region.elb.amazonaws.com
Fix ->
Swapping about the variables lead to successful mapping between LBv1 and the Network interfaces
For LBV2, rather than create a dns name, I suggest using a combination of name and region for the loadbalancerv2 as the combination needs to be unique across the AWS account.