Skip to content

Commit 0aa04d8

Browse files
authored
feat: DTOS 00000 adding config for postgresql ds (#93)
* feat: DTOS 00000 adding config for postgresql ds * feat: DTOS 00000 adding config for postgresql ds
1 parent e2bd5f5 commit 0aa04d8

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

infrastructure/modules/postgresql-flexible/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,17 @@ module "private_endpoint_postgresql_flexible_server" {
9797

9898
tags = var.tags
9999
}
100+
101+
/* --------------------------------------------------------------------------------------------------
102+
PostgreSQL Server Diagnostic Settings
103+
-------------------------------------------------------------------------------------------------- */
104+
module "diagnostic_setting_postgresql_server" {
105+
106+
source = "../diagnostic-settings"
107+
108+
name = "${var.name}-postgresql-server-diagnotic-setting"
109+
target_resource_id = azurerm_postgresql_flexible_server.postgresql_flexible_server.id
110+
log_analytics_workspace_id = var.log_analytics_workspace_id
111+
enabled_log = var.monitor_diagnostic_setting_postgresql_server_enabled_logs
112+
metric = var.monitor_diagnostic_setting_postgresql_server_metrics
113+
}

infrastructure/modules/postgresql-flexible/variables.tf

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,21 @@ variable "private_endpoint_properties" {
154154
})
155155
}
156156

157-
# /* --------------------------------------------------------------------------------------------------
158-
# Auditing and Diagnostics Variables
159-
# -------------------------------------------------------------------------------------------------- */
160-
# variable "monitor_diagnostic_setting_database_enabled_logs" {
161-
# type = list(string)
162-
# description = "Controls what logs will be enabled for the database"
163-
# }
164-
165-
# variable "monitor_diagnostic_setting_database_metrics" {
166-
# type = list(string)
167-
# description = "Controls what metrics will be enabled for the database"
168-
# }
157+
158+
/* --------------------------------------------------------------------------------------------------
159+
Auditing and Diagnostics Variables
160+
-------------------------------------------------------------------------------------------------- */
161+
variable "log_analytics_workspace_id" {
162+
type = string
163+
description = "id of the log analytics workspace to send resource logging to via diagnostic settings"
164+
}
165+
166+
variable "monitor_diagnostic_setting_postgresql_server_enabled_logs" {
167+
type = list(string)
168+
description = "Controls what logs will be enabled for the sql server"
169+
}
170+
171+
variable "monitor_diagnostic_setting_postgresql_server_metrics" {
172+
type = list(string)
173+
description = "Controls what metrics will be enabled for the sql server"
174+
}

0 commit comments

Comments
 (0)