-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ repos: | |
rev: 1.0.0 | ||
hooks: | ||
- id: terraform-validate | ||
args: [--azurerm-provider-version=2.34.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
# DEPLOY AN AZURE LOG ANALYTICS SAVED SEARCH | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
|
||
terraform { | ||
required_version = ">= 0.12.26" | ||
} | ||
|
||
resource "azurerm_log_analytics_saved_search" "search" { | ||
name = var.name | ||
display_name = coalesce(var.display_name, var.name) | ||
category = var.category | ||
log_analytics_workspace_id = var.log_analytics_workspace_id | ||
|
||
query = var.query | ||
|
||
function_alias = var.function_alias | ||
function_parameters = var.function_parameters | ||
|
||
tags = var.tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "id" { | ||
description = "The unique identifier of the saved search." | ||
value = azurerm_log_analytics_saved_search.search.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
variable "name" { | ||
description = "The name of the saved search." | ||
type = string | ||
} | ||
|
||
variable "display_name" { | ||
description = "The friendly display name of the saved search." | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "category" { | ||
description = "The category under which the saved search will be displayed." | ||
type = string | ||
} | ||
|
||
variable "log_analytics_workspace_id" { | ||
description = "The ID of the Log Analytics workspace with which the saved search will be associated." | ||
type = string | ||
} | ||
|
||
variable "query" { | ||
description = "The KQL query for the saved search." | ||
type = string | ||
} | ||
|
||
variable "function_alias" { | ||
description = "The function alias if the query serves as a function." | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "function_parameters" { | ||
description = "A list of parameter definitions (strings) in the following format: `param_name:type=default_value`." | ||
type = set(string) | ||
default = null | ||
} | ||
|
||
variable "tags" { | ||
description = "A mapping of tags to assign to the resource." | ||
type = map(string) | ||
default = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters