Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace.
data "azurerm_log_analytics_workspace" "example" {
name = "acctest-01"
resource_group_name = "acctest"
}
output "log_analytics_workspace_id" {
value = data.azurerm_log_analytics_workspace.example.workspace_id
}
The following arguments are supported:
name
- Specifies the name of the Log Analytics Workspace.resource_group_name
- The name of the resource group in which the Log Analytics workspace is located in.The following attributes are exported:
id
- The ID of the Log Analytics Workspace.
primary_shared_key
- The Primary shared key for the Log Analytics Workspace.
secondary_shared_key
- The Secondary shared key for the Log Analytics Workspace.
workspace_id
- The Workspace (or Customer) ID for the Log Analytics Workspace.
sku
- The SKU of the Log Analytics Workspace.
retention_in_days
- The workspace data retention in days.
daily_quota_gb
- The workspace daily quota for ingestion in GB.
tags
- A mapping of tags assigned to the resource.
The timeouts
block allows you to specify timeouts for certain actions:
read
- (Defaults to 5 minutes) Used when retrieving the Workspace.