CSIT Azure integration
[csit.git] / resources / tools / terraform / azure / 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            = "200.0.0.101"
16     }
17 }
18
19 resource "azurerm_network_interface" "dut2_if1" {
20     name                      = "dut2_if1"
21     location                  = azurerm_resource_group.CSIT.location
22     resource_group_name       = azurerm_resource_group.CSIT.name
23     network_security_group_id = azurerm_network_security_group.CSIT.id
24     enable_ip_forwarding      = "true"
25     enable_accelerated_networking  = "true"
26
27     ip_configuration {
28         name                          = "dut2_if1"
29         subnet_id                     = azurerm_subnet.c.id
30         private_ip_address_allocation = "Static"
31         private_ip_address            = "200.0.0.102"
32     }
33 }
34
35 resource "azurerm_network_interface" "dut1_if1" {
36     name                      = "dut1_if1"
37     location                  = azurerm_resource_group.CSIT.location
38     resource_group_name       = azurerm_resource_group.CSIT.name
39     network_security_group_id = azurerm_network_security_group.CSIT.id
40     enable_ip_forwarding      = "true"
41     enable_accelerated_networking  = "true"
42
43     ip_configuration {
44         name                          = "dut1_if1"
45         subnet_id                     = azurerm_subnet.b.id
46         private_ip_address_allocation = "Static"
47         private_ip_address            = "192.168.10.11"
48     }
49 }
50
51 resource "azurerm_network_interface" "dut2_if2" {
52     name                      = "dut2_if2"
53     location                  = azurerm_resource_group.CSIT.location
54     resource_group_name       = azurerm_resource_group.CSIT.name
55     network_security_group_id = azurerm_network_security_group.CSIT.id
56     enable_ip_forwarding      = "true"
57     enable_accelerated_networking  = "true"
58
59     ip_configuration {
60         name                          = "dut2_if2"
61         subnet_id                     = azurerm_subnet.d.id
62         private_ip_address_allocation = "Static"
63         private_ip_address            = "192.168.20.11"
64     }
65 }
66
67 resource "azurerm_network_interface" "tg_if1" {
68     name                      = "tg_if1"
69     location                  = azurerm_resource_group.CSIT.location
70     resource_group_name       = azurerm_resource_group.CSIT.name
71     network_security_group_id = azurerm_network_security_group.CSIT.id
72     enable_ip_forwarding      = "true"
73     enable_accelerated_networking  = "true"
74
75     ip_configuration {
76         name                          = "tg1"
77         subnet_id                     = azurerm_subnet.b.id
78         private_ip_address_allocation = "Static"
79         private_ip_address            = "192.168.10.254"
80     }
81 }
82
83 resource "azurerm_network_interface" "tg_if2" {
84     name                      = "tg_if2"
85     location                  = azurerm_resource_group.CSIT.location
86     resource_group_name       = azurerm_resource_group.CSIT.name
87     network_security_group_id = azurerm_network_security_group.CSIT.id
88     enable_ip_forwarding      = "true"
89     enable_accelerated_networking  = "true"
90
91     ip_configuration {
92         name                          = "tg2"
93         subnet_id                     = azurerm_subnet.d.id
94         private_ip_address_allocation = "Static"
95         private_ip_address            = "192.168.20.254"
96     }
97 }
98