Skip to content

Data Source: azurermLogAnalyticsWorkspace

Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace.

Example Usage

import * as cdktf from "cdktf";
/*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 dataAzurermLogAnalyticsWorkspaceExample =
  new azurerm.dataAzurermLogAnalyticsWorkspace.DataAzurermLogAnalyticsWorkspace(
    this,
    "example",
    {
      name: "acctest-01",
      resource_group_name: "acctest",
    }
  );
new cdktf.TerraformOutput(this, "log_analytics_workspace_id", {
  value: dataAzurermLogAnalyticsWorkspaceExample.workspaceId,
});

Argument Reference

The following arguments are supported:

  • name - Specifies the name of the Log Analytics Workspace.
  • resourceGroupName - The name of the resource group in which the Log Analytics workspace is located in.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Log Analytics Workspace.

  • primarySharedKey - The Primary shared key for the Log Analytics Workspace.

  • secondarySharedKey - The Secondary shared key for the Log Analytics Workspace.

  • workspaceId - The Workspace (or Customer) ID for the Log Analytics Workspace.

  • sku - The SKU of the Log Analytics Workspace.

  • retentionInDays - The workspace data retention in days.

  • dailyQuotaGb - The workspace daily quota for ingestion in GB.

  • tags - A mapping of tags assigned to the resource.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the Workspace.