Route NAT64 to NAT Gateway in IPv6 private topology

This commit is contained in:
John Gardiner Myers 2021-11-26 16:06:32 -08:00
parent 1d8d92b02b
commit 26e836ef11
2 changed files with 23 additions and 0 deletions

View File

@ -498,6 +498,17 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
c.AddTask(r)
if b.IsIPv6Only() {
// Route NAT64 well-known prefix to the NAT gateway
c.AddTask(&awstasks.Route{
Name: fi.String("private-" + zone + "-64:ff9b::/96"),
Lifecycle: b.Lifecycle,
IPv6CIDR: fi.String("64:ff9b::/96"),
RouteTable: rt,
// Only one of these will be not nil
NatGateway: ngw,
TransitGatewayID: tgwID,
})
// Route IPv6 to the Egress-only Internet Gateway.
c.AddTask(&awstasks.Route{
Name: fi.String("private-" + zone + "-::/0"),

View File

@ -596,6 +596,12 @@ resource "aws_route" "route-private-us-test-1a-0-0-0-0--0" {
route_table_id = aws_route_table.private-us-test-1a-minimal-ipv6-example-com.id
}
resource "aws_route" "route-private-us-test-1a-64_ff9b__--96" {
destination_ipv6_cidr_block = "64:ff9b::/96"
nat_gateway_id = aws_nat_gateway.us-test-1a-minimal-ipv6-example-com.id
route_table_id = aws_route_table.private-us-test-1a-minimal-ipv6-example-com.id
}
resource "aws_route" "route-private-us-test-1a-__--0" {
destination_ipv6_cidr_block = "::/0"
egress_only_gateway_id = aws_egress_only_internet_gateway.minimal-ipv6-example-com.id
@ -608,6 +614,12 @@ resource "aws_route" "route-private-us-test-1b-0-0-0-0--0" {
route_table_id = aws_route_table.private-us-test-1b-minimal-ipv6-example-com.id
}
resource "aws_route" "route-private-us-test-1b-64_ff9b__--96" {
destination_ipv6_cidr_block = "64:ff9b::/96"
nat_gateway_id = aws_nat_gateway.us-test-1b-minimal-ipv6-example-com.id
route_table_id = aws_route_table.private-us-test-1b-minimal-ipv6-example-com.id
}
resource "aws_route" "route-private-us-test-1b-__--0" {
destination_ipv6_cidr_block = "::/0"
egress_only_gateway_id = aws_egress_only_internet_gateway.minimal-ipv6-example-com.id