Skip to content

azurermLogAnalyticsDatasourceWindowsEvent

Manages a Log Analytics Windows Event DataSource.

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.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermLogAnalyticsWorkspaceExample =
  new azurerm.logAnalyticsWorkspace.LogAnalyticsWorkspace(this, "example_2", {
    location: azurermResourceGroupExample.location,
    name: "example-law",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "PerGB2018",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLogAnalyticsWorkspaceExample.overrideLogicalId("example");
const azurermLogAnalyticsDatasourceWindowsEventExample =
  new azurerm.logAnalyticsDatasourceWindowsEvent.LogAnalyticsDatasourceWindowsEvent(
    this,
    "example_3",
    {
      event_log_name: "Application",
      event_types: ["Error"],
      name: "example-lad-wpc",
      resource_group_name: azurermResourceGroupExample.name,
      workspace_name: azurermLogAnalyticsWorkspaceExample.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.*/
azurermLogAnalyticsDatasourceWindowsEventExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Log Analytics Windows Event DataSource. Changing this forces a new Log Analytics Windows Event DataSource to be created.

  • resourceGroupName - (Required) The name of the Resource Group where the Log Analytics Windows Event DataSource should exist. Changing this forces a new Log Analytics Windows Event DataSource to be created.

  • workspaceName - (Required) The name of the Log Analytics Workspace where the Log Analytics Windows Event DataSource should exist. Changing this forces a new Log Analytics Windows Event DataSource to be created.

  • eventLogName - (Required) Specifies the name of the Windows Event Log to collect events from.

  • eventTypes - (Required) Specifies an array of event types applied to the specified event log. Possible values include error, warning and information.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Log Analytics Windows Event DataSource.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Log Analytics Windows Event DataSource.
  • read - (Defaults to 5 minutes) Used when retrieving the Log Analytics Windows Event DataSource.
  • update - (Defaults to 30 minutes) Used when updating the Log Analytics Windows Event DataSource.
  • delete - (Defaults to 30 minutes) Used when deleting the Log Analytics Windows Event DataSource.

Import

Log Analytics Windows Event DataSources can be imported using the resourceId, e.g.

terraform import azurerm_log_analytics_datasource_windows_event.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/dataSources/datasource1