This course covers the core learning objective to meet the requirements of the 'Designing secure solutions in AWS - Level 2' skill
- Analyze the available options to secure credentials using features of AWS Identity and Access Management (IAM)
- Evaluate the appropriate routing mechanism to securely access AWS service endpoints or internet-based resources from an Amazon VPC
- Evaluate the appropriate encryption options available for data in transit and when at rest across AWS services
- Evaluate the most appropriate key management service and options based on business requirements and governance controls
In this lecture, we will discuss VPC default routing. When you create a VPC, an implicit route is created for you. You cannot see this router but it's there. This route is connected to each VPC subnet and address by using the first IP address of each subnet. We interact with router by using route tables. When created each VPC has a default route table. This route table will contain targets identified as local. Here you can see an example of this. The local target is used for all packages going through the router that the destination address matched by the 10.0.0.0/16 entry. 10.0.0.0/16 is the IPv4 CIDR block assigned to our VPC from which all the VPC subnets will obtain their address ranges. The local entry cannot be altered and it cannot be deleted. This local entry means that EC2 instances deployed to different subnets in the same VPC will be able to route to each other. But what if EC2 instances want to be able to route the Internet?
How will that affect our route tables? To allow instances in public subnets who also have public IP addresses to route traffic to the internet, we need to request an Internet gateway for our VPC and adjust the route table to route traffic through the internet gateway. Here is an example of what the route table would look like when configured to use an Internet gateway. Here we can see that we have added a default IPv4 route of 0.0.0.0/0 that sends traffic to the Internet gateway. An Internet gateway must be requested attached to VPC in order for it to appear as a target in our route table. Now, any traffic matching 10.0.0.0/16 will be sent locally, everything else will be sent through the Internet gateway. But what about IPv6? Well, IPv6 works in the same way. Here's an example of route in IPv6 and route in IPv6 traffic through an Internet gateway. To allow instances in private subnets who only have private IP addresses to access the Internet, we typically use a NAT gateway. The NAT gateway is deployed to a public subnet, so that it can use the Internet gateway to access the Internet. We then create a new route table, associate the private subnets with a new route table, and add a route that route's Internet traffic through the NAT gateway.
This is how the route table might look. Here we see the default route 0.0.0.0/0, but this time traffic that matches 0.0.0.0/0 is sent to target NAT gateway. This is the NAT gateway deployed to a public subnet. We have then used the subnet associations tab and explicitly associated our private subnets with the route table. Subnets can only be associated with one route table at a time. So, by associating the private subnets with this route table, we are removing their associations with the default route table. In every VPC, one route table it designated the main route table. This is the route table that all new subnets are associated with.
Because of this and to reduce the chances of new subnets being given access to routes that they shouldn't be able to use, it is recommended that main route table only contains the local route. Route in IPv6 traffic the Internet from a private subnet works slightly differently than IPv4. IPv6 traffic from a private subnet is routed through an egress-only Internet gateway. Egress-only internet gateways work just like a NAT gateway, but for IPv6 traffic instead of IP version 4. You request an egress-only Internet gateway in the same way you request an Internet gateway and you attach it to your VPC. You then edit a route table to use it. Here's an example of a route table configured to use an egress-only Internet gateway.
Stuart has been working within the IT industry for two decades covering a huge range of topic areas and technologies, from data center and network infrastructure design, to cloud architecture and implementation.
To date, Stuart has created 150+ courses relating to Cloud reaching over 180,000 students, mostly within the AWS category and with a heavy focus on security and compliance.
Stuart is a member of the AWS Community Builders Program for his contributions towards AWS.
He is AWS certified and accredited in addition to being a published author covering topics across the AWS landscape.
In January 2016 Stuart was awarded ‘Expert of the Year Award 2015’ from Experts Exchange for his knowledge share within cloud services to the community.
Stuart enjoys writing about cloud technologies and you will find many of his articles within our blog pages.