Azure / terraform-azurerm-avm-res-storage-storageaccount

This Terraform module is designed to create Azure Storage Accounts and its related resources, including blob containers, queues, tables, and file shares. It also supports the creation of a storage account private endpoint which provides secure and direct connectivity to Azure Storage over a private network.
https://registry.terraform.io/modules/Azure/avm-res-storage-storageaccount
MIT License
19 stars 27 forks source link

Support for sending diagnostics to event hubs #99

Closed digorgonzola closed 2 months ago

digorgonzola commented 3 months ago

Is there an existing issue for this?

Description

The current implementation of the azurerm_monitor_diagnostic_setting resource does not support sending events to an event hub.

New or Affected Resource(s)/Data Source(s)

azurerm_monitor_diagnostic_setting

Potential Terraform Configuration

resource "azurerm_monitor_diagnostic_setting" "this" {
  for_each = var.diagnostic_settings

  name                           = each.value.name != null ? each.value.name : "diag-${var.name}"
  target_resource_id             = azurerm_key_vault.this.id
  eventhub_authorization_rule_id = each.value.event_hub_authorization_rule_resource_id
  eventhub_name                  = each.value.event_hub_name
  log_analytics_destination_type = each.value.log_analytics_destination_type
  log_analytics_workspace_id     = each.value.workspace_resource_id
  partner_solution_id            = each.value.marketplace_partner_resource_id
  storage_account_id             = each.value.storage_account_resource_id

  dynamic "enabled_log" {
    for_each = each.value.log_categories
    content {
      category = enabled_log.value
    }
  }
  dynamic "enabled_log" {
    for_each = each.value.log_groups
    content {
      category_group = enabled_log.value
    }
  }
  dynamic "metric" {
    for_each = each.value.metric_categories
    content {
      category = metric.value
    }
  }
}

References

No response

digorgonzola commented 3 months ago

Looking more closely at this, it appears to be an oversight in resource blocks as the variables-diagnostics.tf file has the input parameter for event hubs: https://github.com/Azure/terraform-azurerm-avm-res-storage-storageaccount/blob/da400b1482f64f7b352b16b1bb10fcaa92119464/variables.diagnostics.tf#L12

digorgonzola commented 3 months ago

@chinthakaru I'd be happy to create a PR for this.

chinthakaru commented 2 months ago

@digorgonzola Thanks a lot for the interest to create a PR on this. But this has been developed in a another branch and waiting to deploy soon.

chinthakaru commented 2 months ago

Event Hub supportability has been added to the module and this issue should be resolved.

microsoft-github-policy-service[bot] commented 2 months ago

[!NOTE] The "Status: In PR :point_right:" label was removed as per ITA23.