Skip to content

azurermApiManagementLogger

Manages a Logger within an API Management Service.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermApiManagementExample = new azurerm.apiManagement.ApiManagement(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-apim",
    publisher_email: "company@terraform.io",
    publisher_name: "My Company",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Developer_1",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementExample.overrideLogicalId("example");
const azurermApplicationInsightsExample =
  new azurerm.applicationInsights.ApplicationInsights(this, "example_2", {
    application_type: "other",
    location: azurermResourceGroupExample.location,
    name: "example-appinsights",
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApplicationInsightsExample.overrideLogicalId("example");
const azurermApiManagementLoggerExample =
  new azurerm.apiManagementLogger.ApiManagementLogger(this, "example_3", {
    api_management_name: azurermApiManagementExample.name,
    application_insights: [
      {
        instrumentation_key:
          azurermApplicationInsightsExample.instrumentationKey,
      },
    ],
    name: "example-logger",
    resource_group_name: azurermResourceGroupExample.name,
    resource_id: azurermApplicationInsightsExample.id,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermApiManagementLoggerExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of this Logger, which must be unique within the API Management Service. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

  • apiManagementName - (Required) The name of the API Management Service. Changing this forces a new resource to be created.

  • applicationInsights - (Optional) An applicationInsights block as documented below. Changing this forces a new resource to be created.

  • buffered - (Optional) Specifies whether records should be buffered in the Logger prior to publishing. Defaults to true.

  • description - (Optional) A description of this Logger.

  • eventhub - (Optional) An eventhub block as documented below. Changing this forces a new resource to be created.

  • resourceId - (Optional) The target resource id which will be linked in the API-Management portal page. Changing this forces a new resource to be created.


An applicationInsights block supports the following:

  • instrumentationKey - (Required) The instrumentation key used to push data to Application Insights.

An eventhub block supports the following:

  • name - (Required) The name of an EventHub.

  • connectionString - (Required) The connection string of an EventHub Namespace.

Attributes Reference

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

  • id - The ID of the API Management Logger.

Timeouts

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

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

Import

API Management Loggers can be imported using the resourceId, e.g.

terraform import azurerm_api_management_logger.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.ApiManagement/service/example-apim/loggers/example-logger