Refactor storage solution
[csit.git] / terraform-ci-infra / 3n_azure_fsv2 / nic.tf
1 # Create a network interface for the data-plane traffic
2
3 resource "azurerm_network_interface" "dut1_if2" {
4     name                      = "dut1_if2"
5     location                  = azurerm_resource_group.CSIT.location
6     resource_group_name       = azurerm_resource_group.CSIT.name
7     network_security_group_id = azurerm_network_security_group.CSIT.id
8     enable_ip_forwarding      = "true"
9     enable_accelerated_networking  = "true"
10
11     ip_configuration {
12         name                          = "dut1_if2"
13         subnet_id                     = azurerm_subnet.c.id
14         private_ip_address_allocation = "Static"
15         private_ip_address            = "172.16.200.101"
16     }
17 }
18
19 data "azurerm_network_interface" "dut1_if2" {
20   name                = "dut1_if2"
21   resource_group_name = azurerm_resource_group.CSIT.name
22   depends_on          = [ azurerm_virtual_machine.dut1 ]
23 }
24
25 resource "azurerm_network_interface" "dut2_if1" {
26     name                      = "dut2_if1"
27     location                  = azurerm_resource_group.CSIT.location
28     resource_group_name       = azurerm_resource_group.CSIT.name
29     network_security_group_id = azurerm_network_security_group.CSIT.id
30     enable_ip_forwarding      = "true"
31     enable_accelerated_networking  = "true"
32
33     ip_configuration {
34         name                          = "dut2_if1"
35         subnet_id                     = azurerm_subnet.c.id
36         private_ip_address_allocation = "Static"
37         private_ip_address            = "172.16.200.102"
38     }
39 }
40
41 data "azurerm_network_interface" "dut2_if1" {
42   name                = "dut2_if1"
43   resource_group_name = azurerm_resource_group.CSIT.name
44   depends_on          = [ azurerm_virtual_machine.dut2 ]
45 }
46
47 resource "azurerm_network_interface" "dut1_if1" {
48     name                      = "dut1_if1"
49     location                  = azurerm_resource_group.CSIT.location
50     resource_group_name       = azurerm_resource_group.CSIT.name
51     network_security_group_id = azurerm_network_security_group.CSIT.id
52     enable_ip_forwarding      = "true"
53     enable_accelerated_networking  = "true"
54
55     ip_configuration {
56         name                          = "dut1_if1"
57         subnet_id                     = azurerm_subnet.b.id
58         private_ip_address_allocation = "Static"
59         private_ip_address            = "172.16.10.11"
60     }
61 }
62
63 data "azurerm_network_interface" "dut1_if1" {
64   name                = "dut1_if1"
65   resource_group_name = azurerm_resource_group.CSIT.name
66   depends_on          = [ azurerm_virtual_machine.dut1 ]
67 }
68
69 resource "azurerm_network_interface" "dut2_if2" {
70     name                      = "dut2_if2"
71     location                  = azurerm_resource_group.CSIT.location
72     resource_group_name       = azurerm_resource_group.CSIT.name
73     network_security_group_id = azurerm_network_security_group.CSIT.id
74     enable_ip_forwarding      = "true"
75     enable_accelerated_networking  = "true"
76
77     ip_configuration {
78         name                          = "dut2_if2"
79         subnet_id                     = azurerm_subnet.d.id
80         private_ip_address_allocation = "Static"
81         private_ip_address            = "172.16.20.11"
82     }
83 }
84
85 data "azurerm_network_interface" "dut2_if2" {
86   name                = "dut2_if2"
87   resource_group_name = azurerm_resource_group.CSIT.name
88   depends_on          = [ azurerm_virtual_machine.dut2 ]
89 }
90
91 resource "azurerm_network_interface" "tg_if1" {
92     name                      = "tg_if1"
93     location                  = azurerm_resource_group.CSIT.location
94     resource_group_name       = azurerm_resource_group.CSIT.name
95     network_security_group_id = azurerm_network_security_group.CSIT.id
96     enable_ip_forwarding      = "true"
97     enable_accelerated_networking  = "true"
98
99     ip_configuration {
100         name                          = "tg1"
101         subnet_id                     = azurerm_subnet.b.id
102         private_ip_address_allocation = "Static"
103         private_ip_address            = "172.16.10.250"
104     }
105 }
106
107 data "azurerm_network_interface" "tg_if1" {
108   name                = "tg_if1"
109   resource_group_name = azurerm_resource_group.CSIT.name
110   depends_on          = [ azurerm_virtual_machine.tg ]
111 }
112
113 resource "azurerm_network_interface" "tg_if2" {
114     name                      = "tg_if2"
115     location                  = azurerm_resource_group.CSIT.location
116     resource_group_name       = azurerm_resource_group.CSIT.name
117     network_security_group_id = azurerm_network_security_group.CSIT.id
118     enable_ip_forwarding      = "true"
119     enable_accelerated_networking  = "true"
120
121     ip_configuration {
122         name                          = "tg2"
123         subnet_id                     = azurerm_subnet.d.id
124         private_ip_address_allocation = "Static"
125         private_ip_address            = "172.16.20.250"
126     }
127 }
128
129 data "azurerm_network_interface" "tg_if2" {
130   name                = "tg_if2"
131   resource_group_name = azurerm_resource_group.CSIT.name
132   depends_on          = [ azurerm_virtual_machine.tg ]
133 }