generated from azurenoops/terraform-module-overlays-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoutputs.tf
214 lines (176 loc) · 7.89 KB
/
outputs.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Resource Group
output "resource_group_name" {
description = "The name of the resource group in which resources are created"
value = element(coalescelist(data.azurerm_resource_group.rgrp[*].name, module.mod_scaffold_rg[*].resource_group_name, [""]), 0)
}
output "resource_group_id" {
description = "The id of the resource group in which resources are created"
value = element(coalescelist(data.azurerm_resource_group.rgrp[*].id, module.mod_scaffold_rg[*].resource_group_id, [""]), 0)
}
output "resource_group_location" {
description = "The location of the resource group in which resources are created"
value = element(coalescelist(data.azurerm_resource_group.rgrp[*].location, module.mod_scaffold_rg[*].resource_group_location, [""]), 0)
}
# Vnet and Subnets
output "virtual_network_name" {
description = "The name of the virtual network"
value = module.hub_vnet.name
}
output "virtual_network_id" {
description = "The id of the virtual network"
value = module.hub_vnet.resource_id
}
output "virtual_network_address_space" {
description = "List of address spaces that are used the virtual network."
value = module.hub_vnet.resource.body.properties.addressSpace.addressPrefixes
}
output "gateway_subnet_id" {
description = "Name of gateway subnet id"
value = var.gateway_subnet_address_prefix != null ? module.gw_snet[0].resource_id : null
}
output "gateway_subnet_name" {
description = "Name of gateway subnet"
value = var.gateway_subnet_address_prefix != null ? module.gw_snet[0].name : null
}
output "firewall_client_subnet_id" {
description = "Name of firewall client subnet id"
value = var.enable_firewall ? module.firewall_client_snet[0].resource_id : null
}
output "firewall_client_subnet_name" {
description = "Name of gateway subnet"
value = var.enable_firewall ? module.firewall_client_snet[0].name : null
}
output "firewall_management_subnet_id" {
description = "Name of firewall management subnet id"
value = var.enable_forced_tunneling && var.firewall_management_snet_address_prefix != null ? module.firewall_management_snet[0].resource_id : null
}
output "firewall_management_subnet_name" {
description = "Name of firewall management subnet"
value = var.enable_forced_tunneling && var.firewall_management_snet_address_prefix != null ? module.firewall_management_snet[0].name : null
}
output "subnet_ids" {
description = "Map of ids for default subnets"
value = { for key, id in zipmap(
sort(keys(var.hub_subnets)),
sort(values(module.default_snet)[*]["resource_id"])) :
key => { key = key, id = id } }
}
output "subnet_names" {
description = "Map of names for default subnets"
value = { for key, name in zipmap(
sort(keys(var.hub_subnets)),
sort(values(module.default_snet)[*]["name"])) :
key => { key = key, name = name } }
}
output "subnet_address_prefixes" {
description = "List of address prefix for subnets"
value = flatten(concat([for s in module.default_snet : s.resource.body.properties.addressPrefixes], [var.gateway_subnet_address_prefix != null ? module.gw_snet[0].resource.body.properties.addressPrefixes : null], [(var.enable_firewall) ? module.firewall_client_snet[0].resource.body.properties.addressPrefixes : null], [(var.enable_forced_tunneling && var.firewall_management_snet_address_prefix != null) ? module.firewall_management_snet[0].resource.body.properties.addressPrefixes : null]))
}
# Network Security group ids
output "network_security_group_ids" {
description = "Map of ids for default NSGs"
value = { for key, id in zipmap(
sort(keys(var.hub_subnets)),
sort(values(module.nsg)[*]["resource_id"])) :
key => { key = key, id = id } }
}
output "network_security_group_names" {
description = "Map of names for default NSGs"
value = { for key, name in zipmap(
sort(keys(var.hub_subnets)),
sort(values(module.nsg)[*]["name"])) :
key => { key = key, name = name } }
}
# DDoS Protection Plan
output "ddos_protection_plan_id" {
description = "Ddos protection plan details"
value = var.create_ddos_plan ? module.hub_vnet_ddos[0].resource.id : null
}
# Network Watcher
output "network_watcher_id" {
description = "ID of Network Watcher"
value = data.azurerm_network_watcher.nwatcher.id
}
output "route_table_name" {
description = "The name of the route table"
value = azurerm_route_table.routetable.name
}
output "route_table_id" {
description = "The resource id of the route table"
value = azurerm_route_table.routetable.id
}
output "private_dns_zone_resource_group_name" {
description = "The name of the Private DNS zones resource group within Azure DNS"
value = var.enable_private_dns_zones ? module.mod_dns_rg[0].resource_group_name : null
}
output "private_dns_zone_resource_ids" {
description = "The IDs of the Private DNS zones within Azure DNS"
value = var.enable_private_dns_zones ? { for key, id in zipmap(
sort(local.if_default_private_dns_zones_enabled),
sort(values(module.mod_default_pdz)[*]["private_dns_zone_id"])) :
key => { key = key, id = id } } : null
}
output "private_dns_zone_names" {
description = "The names of Private DNS zones within Azure DNS"
value = var.enable_private_dns_zones ? { for key, name in zipmap(
sort(local.if_default_private_dns_zones_enabled),
sort(values(module.mod_default_pdz)[*]["private_dns_zone_name"])) :
key => { key = key, name = name } } : null
}
output "hub_storage_account_id" {
description = "The ID of the storage account."
value = module.hub_st.resource_id
}
output "hub_storage_account_name" {
description = "The name of the storage account."
value = module.hub_st.name
}
output "hub_storage_account_principal_id" {
value = var.enable_customer_managed_keys ? var.user_assigned_identity_principal_id : null
}
output "public_ip_prefix_id" {
description = "The id of the Public IP Prefix resource"
value = var.enable_firewall ? azurerm_public_ip_prefix.firewall_pref[0].id : null
}
output "firewall_client_public_ip" {
description = "the public ip of firewall."
value = var.enable_firewall ? element(concat([for ip in module.hub_firewall_client_pip : ip.public_ip_address], [""]), 0) : null
}
output "firewall_management_public_ip" {
description = "the public ip of firewall."
value = var.enable_firewall && var.enable_forced_tunneling ? element(concat([for ip in module.hub_firewall_management_pip : ip.public_ip_address], [""]), 0) : null
}
output "firewall_private_ip" {
description = "The private ip of firewall."
value = var.enable_firewall ? module.hub_fw[0].resource.ip_configuration[0].private_ip_address : null
}
output "firewall_id" {
description = "The Resource ID of the Azure Firewall."
value = var.enable_firewall ? module.hub_fw[0].resource_id : null
}
output "firewall_name" {
description = "The name of the Azure Firewall."
value = var.enable_firewall ? module.hub_fw[0].resource.name : null
}
output "firewall_dns_servers" {
description = "The name of the Azure Firewall."
value = var.enable_firewall && var.enable_dns_proxy ? var.dns_servers : null
}
output "azure_bastion_subnet_id" {
description = "The resource ID of Azure bastion subnet"
value = var.enable_bastion_host ? element(concat([module.abs_snet[0].resource_id], [""]), 0) : null
}
output "azure_bastion_public_ip" {
description = "The public IP of the virtual network gateway"
value = var.enable_bastion_host ? module.hub_bastion_pip[0].public_ip_address : null
}
output "azure_bastion_host_id" {
description = "The resource ID of the Bastion Host"
value = var.enable_bastion_host ? module.hub_bastion_host[0].resource_id : null
}
output "azure_bastion_host_fqdn" {
description = "The resource ID of the Bastion Host"
value = var.enable_bastion_host ? module.hub_bastion_host[0].resource.dns_name : null
}