Skip to content

Commit

Permalink
Add monitor services (Azure#84)
Browse files Browse the repository at this point in the history
* add monitor service

* add undefined paramaters

* delete duplicates resources

---------

Co-authored-by: Kondratiev <[email protected]>
  • Loading branch information
kkondratev and Kondratiev authored May 27, 2023
1 parent 172a463 commit 87755e9
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ No modules.
| <a name="output_linux_virtual_machine_scale_set"></a> [linux\_virtual\_machine\_scale\_set](#output\_linux\_virtual\_machine\_scale\_set) | Linux Virtual Machine Scale Set |
| <a name="output_local_network_gateway"></a> [local\_network\_gateway](#output\_local\_network\_gateway) | Local Network Gateway |
| <a name="output_log_analytics_workspace"></a> [log\_analytics\_workspace](#output\_log\_analytics\_workspace) | Log Analytics Workspace |
| <a name="output_monitor_action_group"></a> [monitor\_action\_group]
(#output\_monitor\_action\_group) | Alerts Action group |
| <a name="output_monitor_scheduled_query_rules_alert"></a> [monitor\_scheduled\_query\_rules\_alert]
(#output\_monitor\_scheduled\_query\_rules\_alert) | Alerts scheduled query rules |
| <a name="output_monitor_autoscale_setting"></a> [monitor\_autoscale\_setting]
(#output\_monitor\_autoscale\_setting) | Autoscale Setting |
| <a name="output_monitor_diagnostic_setting"></a> [monitor\_diagnostic\_setting]
(#output\_monitor\_diagnostic\_setting) | Siagnostic setting |
| <a name="output_logic_app_workflow"></a> [logic\_app\_workflow](#output\_logic\_app\_workflow) | Logic App Workflow |
| <a name="output_machine_learning_workspace"></a> [machine\_learning\_workspace](#output\_machine\_learning\_workspace) | Machine Learning Workspace |
| <a name="output_managed_disk"></a> [managed\_disk](#output\_managed\_disk) | Managed Disk |
Expand Down
56 changes: 56 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,46 @@ locals {
scope = "parent"
regex = "^[a-zA-Z0-9-_]+$"
}
monitor_action_group = {
name = substr(join("-", compact([local.prefix, "mag", local.suffix])), 0, 260)
name_unique = substr(join("-", compact([local.prefix, "mag", local.suffix_unique])), 0, 260)
dashes = true
slug = "mag"
min_length = 1
max_length = 260
scope = "resourceGroup"
regex = "^[^%&?\\+\\/]+[^^%&?\\+\\/ ]$"
}
monitor_autoscale_setting = {
name = substr(join("-", compact([local.prefix, "mas", local.suffix])), 0, 260)
name_unique = substr(join("-", compact([local.prefix, "mas", local.suffix_unique])), 0, 260)
dashes = true
slug = "mas"
min_length = 1
max_length = 260
scope = "resourceGroup"
regex = "^[^<>%&#.,?\\+\\/]+[^<>%&#.,?\\+\\/ ]$"
}
monitor_diagnostic_setting = {
name = substr(join("-", compact([local.prefix, "mds", local.suffix])), 0, 260)
name_unique = substr(join("-", compact([local.prefix, "mds", local.suffix_unique])), 0, 260)
dashes = true
slug = "mds"
min_length = 1
max_length = 260
scope = "resourceGroup"
regex = "^[^*<>%:&?\\+\\/]+[^*<>%:&?\\+\\/ ]$"
}
monitor_scheduled_query_rules_alert = {
name = substr(join("-", compact([local.prefix, "msqa", local.suffix])), 0, 260)
name_unique = substr(join("-", compact([local.prefix, "msqa", local.suffix_unique])), 0, 260)
dashes = true
slug = "msqa"
min_length = 1
max_length = 260
scope = "resourceGroup"
regex = "^[^*<>%:{}&#.,?\\+\\/]+[^*<>%:{}&#.,?\\+\\/ ]$"
}
mssql_database = {
name = substr(join("-", compact([local.prefix, "sqldb", local.suffix])), 0, 128)
name_unique = substr(join("-", compact([local.prefix, "sqldb", local.suffix_unique])), 0, 128)
Expand Down Expand Up @@ -2786,6 +2826,22 @@ locals {
valid_name = length(regexall(local.az.mariadb_virtual_network_rule.regex, local.az.mariadb_virtual_network_rule.name)) > 0 && length(local.az.mariadb_virtual_network_rule.name) > local.az.mariadb_virtual_network_rule.min_length
valid_name_unique = length(regexall(local.az.mariadb_virtual_network_rule.regex, local.az.mariadb_virtual_network_rule.name_unique)) > 0
}
monitor_action_group = {
valid_name = length(regexall(local.az.monitor_action_group.regex, local.az.monitor_action_group.name)) > 0 && length(local.az.monitor_action_group.name) > local.az.monitor_action_group.min_length
valid_name_unique = length(regexall(local.az.monitor_action_group.regex, local.az.monitor_action_group.name_unique)) > 0
}
monitor_autoscale_setting = {
valid_name = length(regexall(local.az.monitor_autoscale_setting.regex, local.az.monitor_autoscale_setting.name)) > 0 && length(local.az.monitor_autoscale_setting.name) > local.az.monitor_autoscale_setting.min_length
valid_name_unique = length(regexall(local.az.monitor_autoscale_setting.regex, local.az.monitor_autoscale_setting.name_unique)) > 0
}
monitor_diagnostic_setting = {
valid_name = length(regexall(local.az.monitor_diagnostic_setting.regex, local.az.monitor_diagnostic_setting.name)) > 0 && length(local.az.monitor_diagnostic_setting.name) > local.az.monitor_diagnostic_setting.min_length
valid_name_unique = length(regexall(local.az.monitor_diagnostic_setting.regex, local.az.monitor_diagnostic_setting.name_unique)) > 0
}
monitor_scheduled_query_rules_alert = {
valid_name = length(regexall(local.az.monitor_scheduled_query_rules_alert.regex, local.az.monitor_scheduled_query_rules_alert.name)) > 0 && length(local.az.monitor_scheduled_query_rules_alert.name) > local.az.monitor_scheduled_query_rules_alert.min_length
valid_name_unique = length(regexall(local.az.monitor_scheduled_query_rules_alert.regex, local.az.monitor_scheduled_query_rules_alert.name_unique)) > 0
}
mssql_database = {
valid_name = length(regexall(local.az.mssql_database.regex, local.az.mssql_database.name)) > 0 && length(local.az.mssql_database.name) > local.az.mssql_database.min_length
valid_name_unique = length(regexall(local.az.mssql_database.regex, local.az.mssql_database.name_unique)) > 0
Expand Down
20 changes: 20 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,26 @@ output "mariadb_virtual_network_rule" {
description = "Mariadb Virtual Network Rule"
}

output "monitor_action_group" {
value = local.az.monitor_action_group
description = "Monitor Action Group"
}

output "monitor_autoscale_setting" {
value = local.az.monitor_autoscale_setting
description = "Monitor Autoscale Setting"
}

output "monitor_diagnostic_setting" {
value = local.az.monitor_diagnostic_setting
description = "Monitor Diagnostic Setting"
}

output "monitor_scheduled_query_rules_alert" {
value = local.az.monitor_scheduled_query_rules_alert
description = "Monitor Scheduled Query Rules Alert"
}

output "mssql_database" {
value = local.az.mssql_database
description = "Mssql Database"
Expand Down
44 changes: 44 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,50 @@
"slug": "log",
"dashes": true
},
{
"name": "monitor_action_group",
"length": {
"min": 1,
"max": 260
},
"regex": "^(?=.{1,260}$)[^%&?\\\\+\\\\/]+[^^%&?\\\\+\\\\/ ]$",
"scope": "resourceGroup",
"slug": "mag",
"dashes": true
},
{
"name": "monitor_scheduled_query_rules_alert",
"length": {
"min": 1,
"max": 260
},
"regex": "^(?=.{1,260}$)[^*<>%:{}&#.,?\\\\+\\\\/]+[^*<>%:{}&#.,?\\\\+\\\\/ ]$",
"scope": "resourceGroup",
"slug": "msqa",
"dashes": true
},
{
"name": "monitor_autoscale_setting",
"length": {
"min": 1,
"max": 260
},
"regex": "^(?=.{1,260}$)[^<>%&#.,?\\\\+\\\\/]+[^<>%&#.,?\\\\+\\\\/ ]$",
"scope": "resourceGroup",
"slug": "mas",
"dashes": true
},
{
"name": "monitor_diagnostic_setting",
"length": {
"min": 1,
"max": 260
},
"regex": "^(?=.{1,260}$)[^*<>%:&?\\\\+\\\\/]+[^*<>%:&?\\\\+\\\\/ ]$",
"scope": "resourceGroup",
"slug": "mds",
"dashes": true
},
{
"name": "logic_app_workflow",
"length": {
Expand Down

0 comments on commit 87755e9

Please sign in to comment.