From c0bebe5875b45080a4866499354fb36571c6db26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Wed, 17 Apr 2024 12:40:23 +0200 Subject: [PATCH] Add IPv6 support --- tf/modules/network/main.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tf/modules/network/main.tf b/tf/modules/network/main.tf index df056e23..cb7c9ada 100644 --- a/tf/modules/network/main.tf +++ b/tf/modules/network/main.tf @@ -4,12 +4,15 @@ resource "aws_vpc" "main" { enable_dns_hostnames = true enable_dns_support = true + assign_generated_ipv6_cidr_block = true + tags = var.tags } resource "aws_subnet" "main" { count = var.az_count cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 8, count.index) + ipv6_cidr_block = cidrsubnet(aws_vpc.main.ipv6_cidr_block, 8, count.index) availability_zone = var.aws_availability_zones_available.names[count.index] vpc_id = aws_vpc.main.id @@ -24,8 +27,9 @@ resource "aws_route_table" "r" { vpc_id = aws_vpc.main.id route { - cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.gw.id + cidr_block = "0.0.0.0/0" + ipv6_cidr_block = "::/0" + gateway_id = aws_internet_gateway.gw.id } tags = var.tags