diff options
Diffstat (limited to 'fdio.infra.terraform/3n_aws_c5n/deploy')
-rw-r--r-- | fdio.infra.terraform/3n_aws_c5n/deploy/main.tf | 31 | ||||
-rw-r--r-- | fdio.infra.terraform/3n_aws_c5n/deploy/variables.tf | 12 |
2 files changed, 36 insertions, 7 deletions
diff --git a/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf b/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf index dd994cce0c..188b095b55 100644 --- a/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf +++ b/fdio.infra.terraform/3n_aws_c5n/deploy/main.tf @@ -4,7 +4,7 @@ data "vault_aws_access_credentials" "creds" { } resource "aws_vpc" "CSITVPC" { - assign_generated_ipv6_cidr_block = false + assign_generated_ipv6_cidr_block = true enable_dns_hostnames = false enable_dns_support = true cidr_block = var.vpc_cidr_mgmt @@ -30,7 +30,13 @@ resource "aws_security_group" "CSITSG" { to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] - ipv6_cidr_blocks = [] + } + + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + ipv6_cidr_blocks = ["::/0"] } ingress { @@ -38,7 +44,7 @@ resource "aws_security_group" "CSITSG" { to_port = 0 protocol = -1 self = true - ipv6_cidr_blocks = [] + ipv6_cidr_blocks = ["::/0"] } egress { @@ -46,7 +52,13 @@ resource "aws_security_group" "CSITSG" { to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] - ipv6_cidr_blocks = [] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + ipv6_cidr_blocks = ["::/0"] } tags = { @@ -87,6 +99,7 @@ resource "aws_subnet" "mgmt" { depends_on = [ aws_vpc.CSITVPC ] + ipv6_cidr_block = cidrsubnet(aws_vpc.CSITVPC.ipv6_cidr_block, 8, 1) map_public_ip_on_launch = false vpc_id = aws_vpc.CSITVPC.id @@ -103,6 +116,7 @@ resource "aws_subnet" "b" { aws_vpc.CSITVPC, aws_vpc_ipv4_cidr_block_association.b ] + ipv6_cidr_block = cidrsubnet(aws_vpc.CSITVPC.ipv6_cidr_block, 8, 2) map_public_ip_on_launch = false vpc_id = aws_vpc.CSITVPC.id @@ -119,6 +133,7 @@ resource "aws_subnet" "c" { aws_vpc.CSITVPC, aws_vpc_ipv4_cidr_block_association.c ] + ipv6_cidr_block = cidrsubnet(aws_vpc.CSITVPC.ipv6_cidr_block, 8, 3) map_public_ip_on_launch = false vpc_id = aws_vpc.CSITVPC.id @@ -135,6 +150,7 @@ resource "aws_subnet" "d" { aws_vpc.CSITVPC, aws_vpc_ipv4_cidr_block_association.d ] + ipv6_cidr_block = cidrsubnet(aws_vpc.CSITVPC.ipv6_cidr_block, 8, 4) map_public_ip_on_launch = false vpc_id = aws_vpc.CSITVPC.id @@ -424,9 +440,10 @@ resource "aws_route" "CSIT-igw" { aws_vpc.CSITVPC, aws_internet_gateway.CSITGW ] - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.CSITGW.id - route_table_id = aws_vpc.CSITVPC.main_route_table_id + destination_cidr_block = "0.0.0.0/0" + destination_ipv6_cidr_block = "::/0" + gateway_id = aws_internet_gateway.CSITGW.id + route_table_id = aws_vpc.CSITVPC.main_route_table_id } resource "aws_route" "dummy-trex-port-0" { diff --git a/fdio.infra.terraform/3n_aws_c5n/deploy/variables.tf b/fdio.infra.terraform/3n_aws_c5n/deploy/variables.tf index ffd1a350a1..ca87db759c 100644 --- a/fdio.infra.terraform/3n_aws_c5n/deploy/variables.tf +++ b/fdio.infra.terraform/3n_aws_c5n/deploy/variables.tf @@ -92,16 +92,19 @@ variable "vpc_cidr_mgmt" { type = string default = "192.168.0.0/24" } + variable "vpc_cidr_b" { description = "CIDR block B" type = string default = "192.168.10.0/24" } + variable "vpc_cidr_c" { description = "CIDR block C" type = string default = "200.0.0.0/24" } + variable "vpc_cidr_d" { description = "CIDR block D" type = string @@ -114,6 +117,7 @@ variable "trex_dummy_cidr_port_0" { type = string default = "10.0.0.0/24" } + variable "trex_dummy_cidr_port_1" { description = "TREX dummy CIDR" type = string @@ -126,41 +130,49 @@ variable "tg_if1_ip" { type = string default = "192.168.10.254" } + variable "tg_if2_ip" { description = "TG IP on interface 2" type = string default = "192.168.20.254" } + variable "dut1_if1_ip" { description = "DUT IP on interface 1" type = string default = "192.168.10.11" } + variable "dut1_if2_ip" { description = "DUT IP on interface 2" type = string default = "200.0.0.101" } + variable "dut2_if1_ip" { description = "DUT2 IP on interface 1" type = string default = "200.0.0.102" } + variable "dut2_if2_ip" { description = "DUT2 IP on interface 2" type = string default = "192.168.20.11" } + variable "tg_mgmt_ip" { description = "TG management interface IP" type = string default = "192.168.0.10" } + variable "dut1_mgmt_ip" { description = "DUT1 management interface IP" type = string default = "192.168.0.11" } + variable "dut2_mgmt_ip" { description = "DUT2 management interface IP" type = string |