hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.53k stars 4.6k forks source link

Add a data source for azurerm_api_management_logger #12929

Open Elip-tdlr opened 3 years ago

Elip-tdlr commented 3 years ago

Community Note

Description

When trying to create an azurerm_api_management_api_diagnostic within an existing APIM the logger id is required. This is only available on the azurerm_api_management_logger which is only supported as a resource.

Currently, there is only a resource for azurerm_api_management_logger which means there is no way to access the logger id required to configure a logger for new APIs. The azurerm_api_management_logger could be imported but the intent here is not to manage logger, just to use ts id.

New or Affected Resource(s)

azurerm_api_management_api_diagnostic

Potential Terraform Configuration

data "azurerm_api_management_logger" "apim_logger" {
  name                = "app-insights-logger"
  api_management_name = data.azurerm_api_management.apim_service.name
  resource_group_name = data.azurerm_resource_group.shared.name
}

resource "azurerm_api_management_api_diagnostic" "new_api_diag" {
  identifier               = "applicationinsights"
  resource_group_name      = data.azurerm_resource_group.shared.name
  api_management_name      = data.azurerm_api_management.apim_service.name
  api_name                 = azurerm_api_management_api.existing_api.name
  api_management_logger_id = data.azurerm_api_management_logger.apim_logger.id

  sampling_percentage       = var.sampling_percentage
  always_log_errors         = true
  log_client_ip             = true
  verbosity                 = "information"
  http_correlation_protocol = "W3C"
}
sudeep1607 commented 1 year ago

Any update on this? It has been open since 2021 and there is no further update

ivan-zaitsev commented 1 year ago

Any update on this?

qfyra commented 5 months ago

Any update on this?