» azurerm_api_management_diagnostic

Manages an API Management Service Diagnostic.

» Example Usage

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_application_insights" "example" {
  name                = "example-appinsights"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  application_type    = "web"
}

resource "azurerm_api_management" "example" {
  name                = "example-apim"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  publisher_name      = "My Company"
  publisher_email     = "company@terraform.io"
  sku_name            = "Developer_1"
}
resource "azurerm_api_management_logger" "example" {
  name                = "example-apimlogger"
  api_management_name = azurerm_api_management.example.name
  resource_group_name = azurerm_resource_group.example.name

  application_insights {
    instrumentation_key = azurerm_application_insights.example.instrumentation_key
  }
}

resource "azurerm_api_management_diagnostic" "example" {
  identifier               = "applicationinsights"
  resource_group_name      = azurerm_resource_group.example.name
  api_management_name      = azurerm_api_management.example.name
  api_management_logger_id = azurerm_api_management_logger.example.id
}

» Argument Reference

The following arguments are supported:

  • identifier - (Required) The diagnostic identifier for the API Management Service. At this time the only supported value is applicationinsights. Changing this forces a new resource to be created.

  • api_management_name - (Required) The Name of the API Management Service where this Diagnostic should be created. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created.

  • api_management_logger_id - (Required) The id of the target API Management Logger where the API Management Diagnostic should be saved.


» Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the API Management Diagnostic.

» Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the API Management Diagnostic.
  • update - (Defaults to 30 minutes) Used when updating the API Management Diagnostic.
  • read - (Defaults to 5 minutes) Used when retrieving the API Management Diagnostic.
  • delete - (Defaults to 30 minutes) Used when deleting the API Management Diagnostic.

» Import

API Management Diagnostics can be imported using the resource id, e.g.

terraform import azurerm_api_management_diagnostic.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/diagnostics/applicationinsights