boto3
boto3 copied to clipboard
EC2.RouteTable.delete_route() is missing
for vpc in ec2.vpcs.all():
for route_table in vpc.route_tables.all():
print(route_table)
print(route_table.meta.client.create_route)
print(route_table.create_route)
print(route_table.meta.client.delete_route)
print(route_table.delete_route)
<bound method EC2.create_route of <botocore.client.EC2 object at 0x7f7a723afdd8>>
<bound method ec2.RouteTable.create_route of ec2.RouteTable(id='rtb-513cb835')>
<bound method EC2.delete_route of <botocore.client.EC2 object at 0x7f7a723afdd8>>
Traceback (most recent call last):
File "./scripts/foo", line 193, in <module>
print(route_table.delete_route)
AttributeError: 'ec2.RouteTable' object has no attribute 'delete_route'
Thanks for your suggestion. We will look into this.
@kislyuk
Agreed there should be some parity. I think route_table.delete_route is a reasonable interface. Feel free to submit a PR to our resource model for EC2 to add this. We can add it as well. If you have any other questions feel free to ask.
I'm running into the same issue.
---> 29 x = ec2_client.delete_route(RouteTableId=route_table.id,DestinationCidrBlock=route['DestinationCidrBlock'])
30 print x
31
AttributeError: 'ec2.ServiceResource' object has no attribute 'delete_route'
ditto - quite annoying as I have to shell call the CLI to delete routes :(