I want to filter and list ELBs with specific vpcid using boto3. Using that ELB name I want to delete that ELB using boto3
It would be something like:
import boto3
client = boto3.client('elbv2', region="ap_southeast_2")
response = client.describe_load_balancers()
# Get ELBs
for elb in response['LoadBalancers']:
if elb['VpcId'] == 'vpc-xxx':
# Delete ELB
client.delete_load_balancer(LoadBalancerArn=elb['LoadBalancerArn'])