-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvnet-core-ussc.tf
62 lines (53 loc) · 2.59 KB
/
vnet-core-ussc.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#================ VNET ================
resource "azurerm_virtual_network" "vnet-core-ussc" {
name = "vnet-core-ussc-10.0.0.0_22"
resource_group_name = azurerm_resource_group.rg-network.name
location = "southcentralus"
address_space = ["10.0.0.0/22"]
dns_servers = concat(local.settings.adds.ussc-adds-ip_address, local.settings.adds.euw-adds-ip_address)
# ddos_protection_plan {
# id = azurerm_network_ddos_protection_plan.ddos-plan.id
# enable = true
# }
tags = merge(local.settings.common_tags, local.settings.core_tags)
}
#================ Subnets ================
resource "azurerm_subnet" "subnet-ussc-core-adds" {
name = "subnet-ussc-core-vnet1-adds-10.0.0.64_27"
address_prefixes = ["10.0.0.64/27"]
resource_group_name = azurerm_resource_group.rg-network.name
virtual_network_name = azurerm_virtual_network.vnet-core-ussc.name
service_endpoints = ["Microsoft.KeyVault", "Microsoft.Storage"]
}
resource "azurerm_subnet" "subnet-ussc-core-mgmt" {
name = "subnet-ussc-core-vnet1-mgmt-10.0.0.96_27"
address_prefixes = ["10.0.0.96/27"]
resource_group_name = azurerm_resource_group.rg-network.name
virtual_network_name = azurerm_virtual_network.vnet-core-ussc.name
service_endpoints = ["Microsoft.KeyVault", "Microsoft.Storage"]
}
#================ NSGs ================
resource "azurerm_network_security_group" "nsg-adds" {
name = "subnet-ussc-core-vnet1-adds-nsg"
resource_group_name = azurerm_resource_group.rg-network.name
location = "southcentralus"
}
resource "azurerm_subnet_network_security_group_association" "nsg-adds" {
subnet_id = azurerm_subnet.subnet-ussc-core-adds.id
network_security_group_id = azurerm_network_security_group.nsg-adds.id
}
resource "azurerm_network_security_group" "nsg-mgmt" {
name = "subnet-ussc-core-vnet1-mgmt-nsg"
resource_group_name = azurerm_resource_group.rg-network.name
location = "southcentralus"
}
resource "azurerm_subnet_network_security_group_association" "nsg-mgmt" {
subnet_id = azurerm_subnet.subnet-ussc-core-mgmt.id
network_security_group_id = azurerm_network_security_group.nsg-mgmt.id
}
#================ Hub Connection ================
resource "azurerm_virtual_hub_connection" "vnet-core-ussc-hub2-connection" {
name = "vnet-core-ussc-hub2-connection"
virtual_hub_id = azurerm_virtual_hub.vwan-ussc-hub2.id
remote_virtual_network_id = azurerm_virtual_network.vnet-core-ussc.id
}