-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.tf
More file actions
52 lines (43 loc) · 2.26 KB
/
main.tf
File metadata and controls
52 lines (43 loc) · 2.26 KB
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
/* --------------------------------------------------------------------------------------------------
Azure Relay Namespace
-------------------------------------------------------------------------------------------------- */
resource "azurerm_relay_namespace" "relay" {
name = var.name
resource_group_name = var.resource_group_name
location = var.location
sku_name = var.sku_name
tags = var.tags
}
/* --------------------------------------------------------------------------------------------------
Private Endpoint Configuration for Azure Relay Namespace
-------------------------------------------------------------------------------------------------- */
module "private_endpoint_relay" {
count = var.private_endpoint_properties.private_endpoint_enabled ? 1 : 0
source = "../private-endpoint"
name = "${var.name}-azure-relay-pep"
resource_group_name = var.private_endpoint_properties.private_endpoint_resource_group_name
location = var.location
subnet_id = var.private_endpoint_properties.private_endpoint_subnet_id
private_dns_zone_group = {
name = "${var.name}-azure-relay-pep-zone-group"
private_dns_zone_ids = var.private_endpoint_properties.private_dns_zone_ids_relay
}
private_service_connection = {
name = "${var.name}-relay-pep-connection"
private_connection_resource_id = azurerm_relay_namespace.relay.id
subresource_names = ["namespace"]
is_manual_connection = var.private_endpoint_properties.private_service_connection_is_manual
}
tags = var.tags
}
/* --------------------------------------------------------------------------------------------------
Diagnostic Settings
-------------------------------------------------------------------------------------------------- */
module "diagnostic-settings" {
source = "../diagnostic-settings"
name = "${var.name}-diagnostic-setting"
target_resource_id = azurerm_relay_namespace.relay.id
log_analytics_workspace_id = var.log_analytics_workspace_id
enabled_log = var.monitor_diagnostic_setting_relay_enabled_logs
enabled_metric = var.monitor_diagnostic_setting_relay_metrics
}