Controlling routing within a VPC using Ansible
This recipe covers how to configure routing within an AWS VPC to manage traffic flow across its subnets and to external destinations. By adjusting routing within the VPC, we can control how traffic is directed both internally and when exiting to the internet. So far, we’ve set up the VPC, its subnets, and an IGW for internet connectivity. However, without updates to the VPC’s routing table to point to the IGW, no internal traffic will route through it, making routing adjustments essential to enabling internet-bound traffic.
Note
AWS VPCs include a default route table, automatically assigned to the VPC and any subnet lacking a specific route table. As a result, all subnets within the VPC are initially associated with this default route table.
Let’s go through the process from the data definition to the playbook execution:
- Again, the first step is updating
host_vars/eu_prod_vpc...