-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
169 lines (150 loc) · 5.61 KB
/
main.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# We strongly recommend using the required_providers block to set the
# Azure Provider source and version being used.
# Map each module provider to their corresponding `azurerm` provider using the providers input object
module "caf-enterprise-scale" {
source = "Azure/caf-enterprise-scale/azurerm"
version = "4.0.2" #UPDATE THE MODULE VERSION TO LATEST. CHECK HERE FOR LATEST VERSION https://registry.terraform.io/modules/Azure/caf-enterprise-scale/azurerm/latest
default_location = var.default_location
providers = {
azurerm = azurerm
azurerm.connectivity = azurerm.connectivity
azurerm.management = azurerm.management
}
root_parent_id = data.azurerm_client_config.core.tenant_id
root_id = var.root_id
root_name = var.root_name
deploy_core_landing_zones = var.deploy_core_landing_zones
deploy_corp_landing_zones = var.deploy_corp_landing_zones
deploy_online_landing_zones = var.deploy_online_landing_zones
deploy_identity_resources = var.deploy_identity_resources
deploy_management_resources = var.deploy_management_resources
deploy_connectivity_resources = var.deploy_connectivity_resources
subscription_id_connectivity = data.azurerm_client_config.connectivity.subscription_id
subscription_id_identity = data.azurerm_client_config.identity.subscription_id
subscription_id_management = data.azurerm_client_config.management.subscription_id
configure_identity_resources = local.configure_identity_resources
configure_management_resources = local.configure_management_resources
configure_connectivity_resources = local.configure_connectivity_resources
custom_landing_zones = {
(var.root_id) = {
display_name = "${upper(var.root_id)}"
parent_management_group_id = "${var.tenant_id}"
subscription_ids = []
archetype_config = {
archetype_id = "es_root"
parameters = {}
access_control = {}
}
}
"${var.root_id}-decommissioned" = {
display_name = "Mg-Decommissioned-001"
parent_management_group_id = var.root_id
subscription_ids = []
archetype_config = {
archetype_id = "es_decommissioned"
parameters = {}
access_control = {}
}
}
"${var.root_id}-sandbox" = {
display_name = "Mg-Sandbox-001"
parent_management_group_id = var.root_id
subscription_ids = []
archetype_config = {
archetype_id = "es_sandboxes"
parameters = {}
access_control = {}
}
}
"${var.root_id}-business-apps" = {
display_name = "Mg-Business-Applications-001"
parent_management_group_id = var.root_id
subscription_ids = []
archetype_config = {
archetype_id = "es_landing_zones"
parameters = {}
access_control = {}
}
}
"${var.root_id}-infra-services" = {
display_name = "Mg-Infrastructure-Services-001"
parent_management_group_id = var.root_id
subscription_ids = []
archetype_config = {
archetype_id = "es_platform"
parameters = {}
access_control = {}
}
}
"${var.root_id}-connectivity" = {
display_name = "Mg-Connectivity-001"
parent_management_group_id = "${var.root_id}-infra-services"
subscription_ids = [
"${var.subscription_id_connectivity}",
]
archetype_config = {
archetype_id = "es_connectivity"
parameters = {}
access_control = {}
}
}
"${var.root_id}-management" = {
display_name = "Mg-Management-001"
parent_management_group_id = "${var.root_id}-infra-services"
subscription_ids = [
"${var.subscription_id_management}",
]
archetype_config = {
archetype_id = "es_management"
parameters = {}
access_control = {}
}
}
"${var.root_id}-identity" = {
display_name = "Mg-Identity-001"
parent_management_group_id = "${var.root_id}-infra-services"
subscription_ids = [
"${var.subscription_id_identity}",
]
archetype_config = {
archetype_id = "es_identity"
parameters = {}
access_control = {}
}
}
/*
"${var.root_id}-security" = {
display_name = "Mg-Security-001"
parent_management_group_id = "${var.root_id}-infra-services"
subscription_ids = [
"${var.securitySubscriptionId}",
]
archetype_config = {
archetype_id = "default_empty"
parameters = {}
access_control = {}
}
}
*/
"${var.root_id}-corp" = {
display_name = "Mg-Corp-001"
parent_management_group_id = "${var.root_id}-business-apps"
subscription_ids = []
archetype_config = {
archetype_id = "es_corp"
parameters = {}
access_control = {}
}
}
"${var.root_id}-online" = {
display_name = "Mg-Online-001"
parent_management_group_id = "${var.root_id}-business-apps"
subscription_ids = []
archetype_config = {
archetype_id = "es_online"
parameters = {}
access_control = {}
}
}
}
}