Azure Log Analytics Cluster

This page shows how to write Terraform and Azure Resource Manager for Log Analytics Cluster and write them securely.

azurerm_log_analytics_cluster (Terraform)

The Cluster in Log Analytics can be configured in Terraform with the resource name azurerm_log_analytics_cluster. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L5
resource "azurerm_log_analytics_cluster" "ab_log_analytics_cluster" {
    name                    = var.name
    location                = data.azurerm_resource_group.ab_resource_group.location
    resource_group_name     = data.azurerm_resource_group.ab_resource_group.name
    size_gb                 = var.size_gb

main.tf#L5
resource "azurerm_log_analytics_cluster" "ab_log_analytics_cluster" {
    name                    = var.name
    location                = data.azurerm_resource_group.ab_resource_group.location
    resource_group_name     = data.azurerm_resource_group.ab_resource_group.name
    size_gb                 = var.size_gb

11.loganalytics.tf#L11
resource "azurerm_log_analytics_cluster" "loganal01cluster" {
  name                = "loganal01cluster"
  location            = data.azurerm_resource_group.dev-prolab.location
  resource_group_name = data.azurerm_resource_group.dev-prolab.name

  identity {

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

!> Important Due to capacity constraints, Microsoft requires you to pre-register your subscription IDs before you are allowed to create a Log Analytics cluster. Contact Microsoft, or open a support request to register your subscription IDs.

Note: Log Analytics Clusters are subject to 14-day soft delete policy. Clusters created with the same resource group & name as a previously deleted cluster will be recovered rather than creating anew. Manages a Log Analytics Cluster.

Microsoft.OperationalInsights/clusters (Azure Resource Manager)

The clusters in Microsoft.OperationalInsights can be configured in Azure Resource Manager with the resource name Microsoft.OperationalInsights/clusters. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • identity optional
      • type required - string

        Type of managed service identity.

      • userAssignedIdentities optional - undefined

        The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

  • location required - string

    The geo-location where the resource lives

  • name required - string

    The name of the Log Analytics cluster.

  • properties required
      • associatedWorkspaces optional array
        • billingType optional - string

          The cluster's billing type.

        • capacityReservationProperties optional
          • isAvailabilityZonesEnabled optional - boolean

            Sets whether the cluster will support availability zones. This can be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be modified after cluster creation. Default value is 'true' if region supports Availability Zones.

          • isDoubleEncryptionEnabled optional - boolean

            Configures whether cluster will use double encryption. This Property can not be modified after cluster creation. Default value is 'true'

          • keyVaultProperties optional
              • keyName optional - string

                The name of the key associated with the Log Analytics cluster.

              • keyRsaSize optional - integer

                Selected key minimum required size.

              • keyVaultUri optional - string

                The Key Vault uri which holds they key associated with the Log Analytics cluster.

              • keyVersion optional - string

                The version of the key associated with the Log Analytics cluster.

      • sku optional
          • capacity optional - integer

            The capacity value

          • name optional - string

            The name of the SKU.

      • tags optional - string

        Resource tags.

      • type required - string

      Frequently asked questions

      What is Azure Log Analytics Cluster?

      Azure Log Analytics Cluster is a resource for Log Analytics of Microsoft Azure. Settings can be wrote in Terraform.

      Where can I find the example code for the Azure Log Analytics Cluster?

      For Terraform, the cloudstateu/Terraform-Labs, konradmaleckipl/Terraform-workshop and konradmaleckipl/Terraform-workshop source code examples are useful. See the Terraform Example section for further details.