Skip to content

Commit

Permalink
update deprecated terraform azurerm settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcma-google committed Sep 11, 2024
1 parent 3bcf5b6 commit fa7cc1f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 56 deletions.
17 changes: 8 additions & 9 deletions cloud/azure/modules/app/file-storage.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
resource "azurerm_subnet" "storage_subnet" {
name = "storage-subnet"
resource_group_name = data.azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.civiform_vnet.name
address_prefixes = ["10.0.8.0/24"]
service_endpoints = ["Microsoft.Storage"]
enforce_private_link_endpoint_network_policies = true
name = "storage-subnet"
resource_group_name = data.azurerm_resource_group.rg.name
virtual_network_name = azurerm_virtual_network.civiform_vnet.name
address_prefixes = ["10.0.8.0/24"]
service_endpoints = ["Microsoft.Storage"]
}

resource "azurerm_storage_account" "files_storage_account" {
Expand All @@ -26,9 +25,9 @@ resource "azurerm_storage_container" "files_container" {
}

resource "azurerm_data_protection_backup_policy_blob_storage" "blob_storage_backup_policy" {
name = "storage-backup-policy"
vault_id = azurerm_data_protection_backup_vault.backup_vault.id
retention_duration = "P30D"
name = "storage-backup-policy"
vault_id = azurerm_data_protection_backup_vault.backup_vault.id
operational_default_retention_duration = "P30D"
}

resource "azurerm_data_protection_backup_instance_blob_storage" "blob_storage_backup_instance" {
Expand Down
69 changes: 22 additions & 47 deletions cloud/azure/modules/app/logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,67 +11,42 @@ resource "azurerm_monitor_diagnostic_setting" "app_service_log_analytics" {
target_resource_id = azurerm_linux_web_app.civiform_app.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.civiform_logs.id

log {
enabled_log {
category = "AppServiceAppLogs"

retention_policy {
days = 0
enabled = false
}
}

log {
enabled_log {
category = "AppServiceConsoleLogs"

retention_policy {
days = 0
enabled = false
}
}

log {
enabled_log {
category = "AppServiceHTTPLogs"

retention_policy {
days = 0
enabled = false
}
}

log {
enabled_log {
category = "AppServiceAuditLogs"

retention_policy {
days = 0
enabled = false
}
}
metric {
category = "AllMetrics"

retention_policy {
days = 0
enabled = false
}
}

# due to a bug in terraform include these even though they are not enabled
log {
category = "AppServiceIPSecAuditLogs"
enabled = false

retention_policy {
days = 0
enabled = false
}
}
log {
category = "AppServicePlatformLogs"
enabled = false

retention_policy {
days = 0
enabled = false
}
}
# enabled_log {
# category = "AppServiceIPSecAuditLogs"
# enabled = false

# retention_policy {
# days = 0
# enabled = false
# }
# }
# enabled_log {
# category = "AppServicePlatformLogs"
# enabled = false

# retention_policy {
# days = 0
# enabled = false
# }
# }
}

0 comments on commit fa7cc1f

Please sign in to comment.