-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
85 log analytics private ingestion works
- Loading branch information
1 parent
acd1daa
commit 038d6cf
Showing
11 changed files
with
418 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
85_prometheus_grafana_private_endpoint/data_collection_rule.tf
This file was deleted.
Oops, something went wrong.
13 changes: 6 additions & 7 deletions
13
...vate_endpoint/data_collection_endpoint.tf → ...ana_private_endpoint/dce-log_analytics.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
resource "azurerm_monitor_data_collection_endpoint" "dce-prometheus" { | ||
name = "dce-prometheus" | ||
resource "azurerm_monitor_data_collection_endpoint" "dce-log-analytics" { | ||
name = "dce-log-analytics" | ||
resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
location = azurerm_resource_group.rg_monitoring.location | ||
kind = "Linux" | ||
public_network_access_enabled = false # true # false | ||
public_network_access_enabled = false | ||
} | ||
|
||
# associate to a Data Collection Endpoint | ||
resource "azurerm_monitor_data_collection_rule_association" "dce-aks-prometheus" { | ||
resource "azurerm_monitor_data_collection_rule_association" "dcra-dce-log-analytics-aks" { | ||
name = "configurationAccessEndpoint" # name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint | ||
target_resource_id = azurerm_kubernetes_cluster.aks.id | ||
data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-prometheus.id | ||
} | ||
data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-log-analytics.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# resource "azurerm_monitor_data_collection_endpoint" "dce-prometheus" { | ||
# name = "dce-prometheus" | ||
# resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
# location = azurerm_resource_group.rg_monitoring.location | ||
# kind = "Linux" | ||
# public_network_access_enabled = false # true # false | ||
# } | ||
|
||
# # associate to a Data Collection Endpoint | ||
# resource "azurerm_monitor_data_collection_rule_association" "dcra-dce-prometheus-aks" { | ||
# name = "configurationAccessEndpoint" # "dcra-dce-prometheus-aks" # # name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint | ||
# target_resource_id = azurerm_kubernetes_cluster.aks.id | ||
# data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-prometheus.id | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# resource "azurerm_monitor_data_collection_rule" "dcr-prometheus" { | ||
# name = "dcr-prometheus" | ||
# resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
# location = azurerm_resource_group.rg_monitoring.location | ||
# data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.dce-prometheus.id | ||
# kind = "Linux" | ||
# description = "DCR for Azure Monitor Metrics Profile (Managed Prometheus)" | ||
|
||
# data_sources { | ||
# prometheus_forwarder { | ||
# name = "PrometheusDataSource" | ||
# streams = ["Microsoft-PrometheusMetrics"] | ||
# } | ||
# } | ||
|
||
# destinations { | ||
# monitor_account { | ||
# monitor_account_id = azurerm_monitor_workspace.prometheus.id | ||
# name = azurerm_monitor_workspace.prometheus.name | ||
# } | ||
# } | ||
|
||
# data_flow { | ||
# streams = ["Microsoft-PrometheusMetrics"] | ||
# destinations = [azurerm_monitor_workspace.prometheus.name] | ||
# } | ||
# } | ||
|
||
# # associate to a Data Collection Rule | ||
# resource "azurerm_monitor_data_collection_rule_association" "dcra-dcr-prometheus-aks" { | ||
# name = "dcra-dcr-prometheus-aks" | ||
# target_resource_id = azurerm_kubernetes_cluster.aks.id | ||
# data_collection_rule_id = azurerm_monitor_data_collection_rule.dcr-prometheus.id | ||
# description = "Association of data collection rule. Deleting this association will break the data collection for this AKS Cluster." | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
resource "azurerm_dashboard_grafana" "grafana" { | ||
name = var.grafana_name | ||
resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
location = azurerm_resource_group.rg_monitoring.location | ||
api_key_enabled = true | ||
deterministic_outbound_ip_enabled = true | ||
public_network_access_enabled = true | ||
sku = "Standard" | ||
zone_redundancy_enabled = false | ||
grafana_major_version = "10" # 9 | ||
|
||
azure_monitor_workspace_integrations { | ||
resource_id = azurerm_monitor_workspace.prometheus.id | ||
} | ||
|
||
identity { | ||
type = "SystemAssigned" # "UserAssigned" # | ||
# identity_ids = [azurerm_user_assigned_identity.identity-grafana.id] | ||
} | ||
} | ||
|
||
data "azurerm_client_config" "current" {} | ||
|
||
resource "azurerm_role_assignment" "role_grafana_admin" { | ||
scope = azurerm_dashboard_grafana.grafana.id | ||
role_definition_name = "Grafana Admin" | ||
principal_id = data.azurerm_client_config.current.object_id | ||
} | ||
|
||
resource "azurerm_role_assignment" "role_monitoring_data_reader" { | ||
scope = azurerm_monitor_workspace.prometheus.id | ||
role_definition_name = "Monitoring Data Reader" | ||
principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id # azurerm_user_assigned_identity.identity-grafana.principal_id # | ||
} | ||
|
||
data "azurerm_subscription" "current" {} | ||
|
||
resource "azurerm_role_assignment" "role_monitoring_reader" { | ||
scope = data.azurerm_subscription.current.id | ||
role_definition_name = "Monitoring Reader" | ||
principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id # azurerm_user_assigned_identity.identity-grafana.principal_id # | ||
} | ||
|
||
# resource "azurerm_user_assigned_identity" "identity-grafana" { | ||
# name = "identity-grafana" | ||
# resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
# location = azurerm_resource_group.rg_monitoring.location | ||
# resource "azurerm_dashboard_grafana" "grafana" { | ||
# name = var.grafana_name | ||
# resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
# location = azurerm_resource_group.rg_monitoring.location | ||
# api_key_enabled = true | ||
# deterministic_outbound_ip_enabled = true | ||
# public_network_access_enabled = true | ||
# sku = "Standard" | ||
# zone_redundancy_enabled = false | ||
# grafana_major_version = "10" # 9 | ||
|
||
# azure_monitor_workspace_integrations { | ||
# resource_id = azurerm_monitor_workspace.prometheus.id | ||
# } | ||
|
||
# identity { | ||
# type = "SystemAssigned" # "UserAssigned" # | ||
# # identity_ids = [azurerm_user_assigned_identity.identity-grafana.id] | ||
# } | ||
# } | ||
|
||
# data "azurerm_client_config" "current" {} | ||
|
||
# resource "azurerm_role_assignment" "role_grafana_admin" { | ||
# scope = azurerm_dashboard_grafana.grafana.id | ||
# role_definition_name = "Grafana Admin" | ||
# principal_id = data.azurerm_client_config.current.object_id | ||
# } | ||
|
||
# resource "azurerm_role_assignment" "role_monitoring_data_reader" { | ||
# scope = azurerm_monitor_workspace.prometheus.id | ||
# role_definition_name = "Monitoring Data Reader" | ||
# principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id # azurerm_user_assigned_identity.identity-grafana.principal_id # | ||
# } | ||
|
||
# data "azurerm_subscription" "current" {} | ||
|
||
# resource "azurerm_role_assignment" "role_monitoring_reader" { | ||
# scope = data.azurerm_subscription.current.id | ||
# role_definition_name = "Monitoring Reader" | ||
# principal_id = azurerm_dashboard_grafana.grafana.identity.0.principal_id # azurerm_user_assigned_identity.identity-grafana.principal_id # | ||
# } | ||
|
||
# # resource "azurerm_user_assigned_identity" "identity-grafana" { | ||
# # name = "identity-grafana" | ||
# # resource_group_name = azurerm_resource_group.rg_monitoring.name | ||
# # location = azurerm_resource_group.rg_monitoring.location | ||
# # } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.