Manages a Log Analytics Cluster.
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_log_analytics_cluster" "example" {
name = "example-cluster"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
identity {
type = "SystemAssigned"
}
}
The following arguments are supported:
name
- (Required) The name which should be used for this Log Analytics Cluster. Changing this forces a new Log Analytics Cluster to be created.
resource_group_name
- (Required) The name of the Resource Group where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created.
location
- (Required) The Azure Region where the Log Analytics Cluster should exist. Changing this forces a new Log Analytics Cluster to be created.
identity
- (Required) An identity
block as defined below. Changing this forces a new Log Analytics Cluster to be created.
size_gb
- (Optional) The capacity of the Log Analytics Cluster is specified in GB/day. Possible values include 500
, 1000
, 2000
or 5000
. Defaults to 1000
.
tags
- (Optional) A mapping of tags which should be assigned to the Log Analytics Cluster.An identity
block supports the following:
type
- (Required) Specifies the type of Managed Service Identity that should be configured on this Log Analytics Cluster. The only possible value is SystemAssigned
. Changing this forces a new resource to be created.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Log Analytics Cluster.
identity
- A identity
block as defined below.
cluster_id
- The GUID of the cluster.
An identity
block exports the following:
principal_id
- The Principal ID associated with this Managed Service Identity.
tenant_id
- The Tenant ID associated with this Managed Service Identity.
type
- (Required) The identity type of this Managed Service Identity.
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 6 hours) Used when creating the Log Analytics Cluster.read
- (Defaults to 5 minutes) Used when retrieving the Log Analytics Cluster.update
- (Defaults to 6 hours) Used when updating the Log Analytics Cluster.delete
- (Defaults to 30 minutes) Used when deleting the Log Analytics Cluster.Log Analytics Clusters can be imported using the resource id
, e.g.
terraform import azurerm_log_analytics_cluster.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/clusters/cluster1