# Can't delete an EC2 route table

**URL:** <https://forum.ansible.com/t/cant-delete-an-ec2-route-table/24857>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 29, 2017, 10:11pm UTC](https://forum.ansible.com/t/cant-delete-an-ec2-route-table/24857 "2017-06-29T22:11:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yosemite\_Sam](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yosemite\_Sam](https://forum.ansible.com/u/Yosemite_Sam)\
**Post date:** [June 29, 2017, 10:11pm UTC](https://forum.ansible.com/t/cant-delete-an-ec2-route-table/24857/1 "2017-06-29T22:11:31Z")

</div>

Hello,

I have no idea why this simple test code does not delete a route table. Hopefully, someone with fresh eyes can spot the problem.

Playbook:

`---`

`- name: trythis`  
`hosts: localhost`  
`connection: local`  
`gather_facts: True`

`tasks:`  
`- ec2_vpc_route_table_facts:`  
`region: "{{ aws.region }}"`  
`filters:`  
`route-table-id: rtb-8bb593ef`  
`register: route_table_facts`

`- debug: var=route_table_facts`

`- ec2_vpc_route_table:`  
`region: "{{ aws.region }}"`  
`vpc_id: vpc-8b1277ef`  
`route_table_id: rtb-8bb593ef`  
`state: absent`  
`register: route_table`

`- debug: var=route_table`

Here’s the first debug:

`ok: [localhost] => {`  
`"route_table_facts": {`  
`"changed": false,`  
`"route_tables": [`  
`{`  
`"associations": [],`  
`"id": "rtb-8bb593ef",`  
`"routes": [`  
`{`  
`"destination_cidr_block": "[10.0.0.0/22](http://10.0.0.0/22)",`  
`"gateway_id": "local",`  
`"instance_id": null,`  
`"interface_id": null,`  
`"origin": "CreateRouteTable",`  
`"state": "active",`  
`"vpc_peering_connection_id": null`  
`}`  
`],`  
`"tags": {},`  
`"vpc_id": "vpc-8b1277ef"`  
`}`  
`]`  
`}`  
`}`

Here’s the second debug:

`TASK [debug] *************************************************************************************** `  
`ok: [localhost] => {`  
`"route_table": {`  
`"changed": false`  
`}`  
`}`

Any assistance would be appreciated!

Jack
