# ec2\_vpc\_route\_table - how to configure a local route

**URL:** <https://forum.ansible.com/t/ec2-vpc-route-table-how-to-configure-a-local-route/35464>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [July 5, 2021, 10:28am UTC](https://forum.ansible.com/t/ec2-vpc-route-table-how-to-configure-a-local-route/35464 "2021-07-05T10:28:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerald\_Preissler](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gerald\_Preissler](https://forum.ansible.com/u/Gerald_Preissler)\
**Post date:** [July 5, 2021, 10:28am UTC](https://forum.ansible.com/t/ec2-vpc-route-table-how-to-configure-a-local-route/35464/1 "2021-07-05T10:28:08Z")

</div>

Hi, I’m trying to set up a VPC in AWS using Ansible. I’m running into a problem when I try to create a route table that should route packets to local. The following does not work:

- name: create route table for private subnets  
ec2\_vpc\_route\_table:  
vpc\_id: “{{ vpc\_id }}”  
tags:  
Name: “{{ vpc\_name }}-private”  
subnets:
- “{{ vpc\_subnet\_ids[‘private-a’] }}”  
routes:
- dest: 0.0.0.0/0  
gateway\_id: “local”

This results in the error message “The gateway ID ‘local’ does not exist”.

When I create the route table I want manually using the AWS Console and examine it with ec2\_vpc\_route\_table\_info, I get the following:

“routes”: [  
{  
“destination\_cidr\_block”: “10.0.0.0/16”,  
“gateway\_id”: “local”,  
“instance\_id”: null,  
“interface\_id”: null,  
“network\_interface\_id”: null,  
“origin”: “CreateRouteTable”,  
“state”: “active”  
},

My Google-Fu is too weak to find a solution, does anyone have any hints?

---

<div class="post-metadata">

**Author:** ![Gerald\_Preissler](https://avatars.discourse-cdn.com/v4/letter/g/9de053/32.png) [@Gerald\_Preissler](https://forum.ansible.com/u/Gerald_Preissler)\
**Post date:** [July 6, 2021, 10:21am UTC](https://forum.ansible.com/t/ec2-vpc-route-table-how-to-configure-a-local-route/35464/2 "2021-07-06T10:21:11Z")

</div>

I noticed in the meantime that the RouteTable automatically contains a route to the local network so there is no need to create one specifically.

---

<div class="post-metadata">

**Author:** ![Komal\_Suthar](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@Komal\_Suthar](https://forum.ansible.com/u/Komal_Suthar)\
**Post date:** [July 6, 2021, 11:11am UTC](https://forum.ansible.com/t/ec2-vpc-route-table-how-to-configure-a-local-route/35464/3 "2021-07-06T11:11:42Z")

</div>

Hello,

[https://www.linkedin.com/posts/komalsuthar\_vimaldaga-aws-vpc-activity-6765953256347713538-FdtL](https://www.linkedin.com/posts/komalsuthar_vimaldaga-aws-vpc-activity-6765953256347713538-FdtL)

Hope this helps…
