Closed moshloop closed 6 years ago
I am ultimately trying to get the target group ARN from a loadbalancer but I don't see a way of doing that - the tree might display it, but I can't get just the ARN The AWS cli does return it: aws elbv2 describe-listeners --load-balancer-arn { "Listeners": [ { "ListenerArn": "arn:aws:elasticloadbalancing:eu-central-1:xxxb5adde7", "LoadBalancerArn": "arn:aws:elasticloadbalancing:eu-central-1:xxxx2a", "Port": 80, "Protocol": "HTTP", "DefaultActions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:eu-central-1:xxxf8b02" } ] }, { "ListenerArn": "arn:aws:elasticloadbalancing:eu-central-1:x59810", "LoadBalancerArn": "arn:aws:elasticloadbalancing:eu-central-1:3xa", "Port": 443, "Protocol": "HTTPS", "Certificates": [ { "CertificateArn": "arn:aws:acm:eu-central-1:xfc8c" } ], "SslPolicy": "ELBSecurityPolicy-2016-08", "DefaultActions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:eu-central-1:xxxx:targetgroup/xxxxx/xxxxx" } ] } ]}
On Thu, Feb 1, 2018 3:22 PM, Simon Caplette notifications@github.com wrote: @moshloop The listing of the listener will not include its targetgroups. It seems the AWS API sees listeners as an intermediary components sitting between loadbalancers and targetgroups and that there is no obvious API call to link the two directly.
But using the awless show command, you can have the full tree of relations for the 3 components starting from the load balancer. Run:
awless show name_of_my_loadb
(note: you can add the local flag -l allowing offline exploration of resources using the local storage previoulsy synced.)
In the lineage section, you will see the listeners attached to this loadb. In the applied on, section you will see the targetgroups it applies on.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I will see how if I can implement a way to get this information in the listing and mimic what the aws-cli does.
In the meantime (and a bit more cumbersome) to get the targetgroup ARN from a loadbalancer you can do:
awless show my-loadbalancer-name
awless show my-target-group-name -l
@moshloop Fixed on master.
I have added the TargetGroups
column in the listing of listeners. I display the short ARN for this column since there could be multiple TargetGroups for a listener.
Let me know is that is ok and fixes the issue for you. Thanks.
@simcap awesome - thanks, will test and let you know if their are any issues
@moshloop The listing of the listener will not include its targetgroups. It seems the AWS API sees listeners as an intermediary components sitting between loadbalancers and targetgroups and that there is no obvious API call to link the two directly.
But using the
awless show
command, you can have the full tree of relations for the 3 components starting from the load balancer. Run:(note: you can add the local flag
-l
allowing offline exploration of resources using the local storage previoulsy synced.)In the lineage section, you will see the listeners attached to this loadb. In the applied on, section you will see the targetgroups it applies on.