我想使用boto3筛选和列出具有特定vpcid的ELB。使用该ELB名称,我想使用boto3删除该ELB
答案 0 :(得分:1)
那会是这样的:
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'])