Azure Log Analytics Solution

This page shows how to write Terraform for Log Analytics Solution and write them securely.

azurerm_log_analytics_solution (Terraform)

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

Example Usage from GitHub

main.tf#L14
resource "azurerm_log_analytics_solution" "activity" {
  solution_name         = "AzureActivity"
  location              = var.location
  resource_group_name   = var.resource_group_name
  workspace_resource_id = azurerm_log_analytics_workspace.main.id
  workspace_name        = azurerm_log_analytics_workspace.main.name
logging.tf#L56
resource "azurerm_log_analytics_solution" "containerinsights" {
  provider = azurerm.Management
  solution_name         = "ContainerInsights"
  location              = azurerm_resource_group.logging.location
  resource_group_name   = azurerm_resource_group.logging.name
  workspace_resource_id = azurerm_log_analytics_workspace.platform.id
automation.tf#L22
resource "azurerm_log_analytics_solution" "lawsolutionupdates" {
  solution_name         = "Updates"
  location              = var.law_location
  resource_group_name   = azurerm_automation_account.aa.resource_group_name
  workspace_resource_id = var.law_id
  workspace_name        = var.law_name
main.tf#L13
resource "azurerm_log_analytics_solution" "container" {
  solution_name         = "ContainerInsights"
  location              = azurerm_log_analytics_workspace.log_analytics.location
  resource_group_name   = azurerm_log_analytics_workspace.log_analytics.resource_group_name
  workspace_resource_id = azurerm_log_analytics_workspace.log_analytics.id
  workspace_name        = azurerm_log_analytics_workspace.log_analytics.name
azurerm_log_analytics_workspace.tf#L16
resource "azurerm_log_analytics_solution" "hub_KeyVaultAnalytics" {
  solution_name         = "KeyVaultAnalytics"
  location              = azurerm_resource_group.hub.location
  resource_group_name   = azurerm_resource_group.hub.name
  workspace_resource_id = azurerm_log_analytics_workspace.hub.id
  workspace_name        = azurerm_log_analytics_workspace.hub.name
log_analytics.workspace.tf#L21
resource "azurerm_log_analytics_solution" "aks-sol" {
  solution_name         = "ContainerInsights"
  location              = azurerm_resource_group.rg.location
  resource_group_name   = azurerm_resource_group.rg.name
  workspace_name        = azurerm_log_analytics_workspace.law.name
  workspace_resource_id = azurerm_log_analytics_workspace.law.id

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

Manages a Log Analytics (formally Operational Insights) Solution.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure Log Analytics Solution?

Azure Log Analytics Solution 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 Solution?

For Terraform, the MarkWarnekeMe/Microsoft, liamfoneill/NotQuiteEnterpriseScale and aultt/Azure-Terraform-LabinaBox source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.