-
Notifications
You must be signed in to change notification settings - Fork 0
/
global-network.tf
83 lines (73 loc) · 2.28 KB
/
global-network.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
##
## Create global services networking resources
##
## Create global resource group to contain resources
resource "azurerm_resource_group" "DEMO" {
name = "Demo"
location = "australiasoutheast"
tags {
environment = "demo"
owner = "TS"
CostCentre = "TS"
creator = "Terraform"
}
}
##
## Create global services virtual network
##
resource "azurerm_virtual_network" "DEMO" {
name = "DEMO"
address_space = ["10.180.240.0/20"]
location = "${azurerm_resource_group.DEMO.location}"
resource_group_name = "${azurerm_resource_group.DEMO.name}"
tags {
environment = "DEMO"
owner = "TS"
costCentre = "TS"
product = "Fund_Wide"
creator = "Terraform"
}
}
##
## Create Subnets
##
resource "azurerm_subnet" "DEMO-SN-001" {
name = "DEMO-SN-001"
address_prefix = "10.180.240.0/24"
network_security_group_id = "${azurerm_network_security_group.DEMO-NSG-001.id}"
resource_group_name = "${azurerm_resource_group.DEMO.name}"
virtual_network_name ="${azurerm_virtual_network.DEMO.name}"
}
resource "azurerm_subnet" "DEMO-SN-002" {
name = "DEMO-SN-002"
address_prefix = "10.180.241.0/24"
network_security_group_id = "${azurerm_network_security_group.DEMO-NSG-002.id}"
resource_group_name = "${azurerm_resource_group.DEMO.name}"
virtual_network_name ="${azurerm_virtual_network.DEMO.name}"
}
##
## Create blank NW security groups for subnets
## Application security groups used to secure application flows
##
resource "azurerm_network_security_group" "DEMO-NSG-001" {
name = "DEMO-NSG-001"
location = "${azurerm_resource_group.DEMO.location}"
resource_group_name = "${azurerm_resource_group.DEMO.name}"
tags {
environment = "DEMO"
owner = "TS"
costCentre = "TS"
creator = "Terraform"
}
}
resource "azurerm_network_security_group" "DEMO-NSG-002" {
name = "DEMO-NSG-002"
location = "${azurerm_resource_group.DEMO.location}"
resource_group_name = "${azurerm_resource_group.DEMO.name}"
tags {
environment = "Test"
owner = "BOB"
costCentre = "TS"
creator = "Fund Wide"
}
}