Tes M
Tes M

Reputation: 51

How to check an ELB is associated with any autoscaling group using Boto3

How can I check whether an AWS Elastic Load Balancer, Application Load Balancer or Network Load Balancer is associated with any Auto-Scaling group by passing the Load Balancer name or Load Balancer ARN using Boto3?

Upvotes: 0

Views: 145

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270194

The describe_auto_scaling_groups() command returns a list of LoadBalancerNames.

Therefore, you will need to:

  • Call describe_auto_scaling_groups() to obtain a list of Auto Scaling groups
  • Loop through each returned group and look at the LoadBalancerNames list
  • Compare the entries with your Load Balancer name of interest

Upvotes: 1

Related Questions