Issue
I want to filter and list ELBs with specific vpcid using boto3. Using that ELB name I want to delete that ELB using boto3
Solution
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'])
Answered By - John Rotenstein
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.