Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions infrastructure/modules/service-bus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ module "private_endpoint_service_bus_namespace" {

tags = var.tags
}

module "diagnostic-settings" {
source = "../diagnostic-settings"

count = var.log_analytics_workspace_id != null ? 1 : 0

name = "${var.servicebus_namespace_name}-diagnostic-setting"
target_resource_id = azurerm_servicebus_namespace.this.id
log_analytics_workspace_id = var.log_analytics_workspace_id
enabled_metric = var.monitor_diagnostic_setting_servicebus_metrics
enabled_log = var.monitor_diagnostic_setting_servicebus_enabled_logs
}
30 changes: 30 additions & 0 deletions infrastructure/modules/service-bus/tfdocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,30 @@ Type: `string`

Default: `"uksouth"`

### <a name="input_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#input\_log\_analytics\_workspace\_id)

Description: id of the log analytics workspace to send resource logging to via diagnostic settings. If omitted, Diagnostic Settings will not be enabled.

Type: `string`

Default: `null`

### <a name="input_monitor_diagnostic_setting_servicebus_enabled_logs"></a> [monitor\_diagnostic\_setting\_servicebus\_enabled\_logs](#input\_monitor\_diagnostic\_setting\_servicebus\_enabled\_logs)

Description: controls what logs will be enabled for the service bus

Type: `list(string)`

Default: `[]`

### <a name="input_monitor_diagnostic_setting_servicebus_metrics"></a> [monitor\_diagnostic\_setting\_servicebus\_metrics](#input\_monitor\_diagnostic\_setting\_servicebus\_metrics)

Description: controls what metrics will be enabled for the service bus

Type: `list(string)`

Default: `[]`

### <a name="input_partitioning_enabled"></a> [partitioning\_enabled](#input\_partitioning\_enabled)

Description: Boolean flag which controls whether to enable the topic to be partitioned across multiple message brokers. Changing this forces a new resource to be created.
Expand Down Expand Up @@ -119,6 +143,12 @@ Default: `{}`

The following Modules are called:

### <a name="module_diagnostic-settings"></a> [diagnostic-settings](#module\_diagnostic-settings)

Source: ../diagnostic-settings

Version:

### <a name="module_private_endpoint_service_bus_namespace"></a> [private\_endpoint\_service\_bus\_namespace](#module\_private\_endpoint\_service\_bus\_namespace)

Source: ../private-endpoint
Expand Down
18 changes: 18 additions & 0 deletions infrastructure/modules/service-bus/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,21 @@ variable "private_endpoint_properties" {
error_message = "Both private_dns_zone_ids and private_endpoint_subnet_id must be provided if private_endpoint_enabled is true."
}
}

variable "log_analytics_workspace_id" {
type = string
description = "id of the log analytics workspace to send resource logging to via diagnostic settings. If omitted, Diagnostic Settings will not be enabled."
default = null
}

variable "monitor_diagnostic_setting_servicebus_metrics" {
type = list(string)
description = "controls what metrics will be enabled for the service bus"
default = []
}

variable "monitor_diagnostic_setting_servicebus_enabled_logs" {
type = list(string)
description = "controls what logs will be enabled for the service bus"
default = []
}