Skip to content

Commit

Permalink
Add logging and log analytics workspace terraform code
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKChristou committed Oct 11, 2024
1 parent a59a3bf commit 014ad45
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module "postgresql_v15" {
providers = {
azurerm.postgres_network = azurerm.postgres_network
}

admin_user_object_id = var.jenkins_AAD_objectId
business_area = "cft"
common_tags = var.common_tags
Expand All @@ -100,6 +100,18 @@ module "postgresql_v15" {
{
name = "logfiles.retention_days"
value = "7"
},
{
name = "pg_qs.query_capture_mode"
value = "ALL"
},
{
name = "log_lock_waits"
value = "on"
},
{
name = "pgms_wait_sampling.query_capture_mode"
value = "ALL"
}
]
pgsql_version = "15"
Expand Down Expand Up @@ -143,3 +155,10 @@ resource "azurerm_key_vault_secret" "POSTGRES_DATABASE" {
value = var.database_name
key_vault_id = data.azurerm_key_vault.ccd_shared_key_vault.id
}
resource "azurerm_log_analytics_workspace" "LOG_ANALYTICS_WORKSPACE" {
name = "ccd-log-analytics"
resource_group_name = "${local.sharedResourceGroup}"
location = "${var.location}"
sku = "PerGB2018"
retention_in_days = 30
}

0 comments on commit 014ad45

Please sign in to comment.