Skip to content

azurermLogAnalyticsDatasourceWindowsPerformanceCounter

Manages a Log Analytics (formally Operational Insights) Windows Performance Counter 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 azurermLogAnalyticsDatasourceWindowsPerformanceCounterExample =
  new azurerm.logAnalyticsDatasourceWindowsPerformanceCounter.LogAnalyticsDatasourceWindowsPerformanceCounter(
    this,
    "example_3",
    {
      counter_name: "CPU",
      instance_name: "*",
      interval_seconds: 10,
      name: "example-lad-wpc",
      object_name: "CPU",
      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.*/
azurermLogAnalyticsDatasourceWindowsPerformanceCounterExample.overrideLogicalId(
  "example"
);

Arguments Reference

The following arguments are supported:

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

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

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

  • objectName - (Required) The object name of the Log Analytics Windows Performance Counter DataSource.

  • instanceName - (Required) The name of the virtual machine instance to which the Windows Performance Counter DataSource be applied. Specify a * will apply to all instances.

  • counterName - (Required) The friendly name of the performance counter.

  • intervalSeconds - (Required) The time of sample interval in seconds. Supports values between 10 and 2147483647.

Attributes Reference

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

  • id - The ID of the Log Analytics Windows Performance Counter 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 Performance Counter DataSource.
  • read - (Defaults to 5 minutes) Used when retrieving the Log Analytics Windows Performance Counter DataSource.
  • update - (Defaults to 30 minutes) Used when updating the Log Analytics Windows Performance Counter DataSource.
  • delete - (Defaults to 30 minutes) Used when deleting the Log Analytics Windows Performance Counter DataSource.

Import

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

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