Skip to content

Commit

Permalink
Add IPv6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Apr 17, 2024
1 parent dc245a9 commit c0bebe5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tf/modules/network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit c0bebe5

Please sign in to comment.