Skip to content

Commit

Permalink
Merge pull request #113 from DFE-Digital/1839-postgres
Browse files Browse the repository at this point in the history
[1839] Disable public_network_access_enabled on postgres
  • Loading branch information
saliceti authored Aug 22, 2024
2 parents 73a2937 + 751ff0f commit 780680a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions aks/postgres/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,18 @@ locals {
resource "azurerm_postgresql_flexible_server" "main" {
count = var.use_azure ? 1 : 0

name = local.azure_name
location = data.azurerm_resource_group.main[0].location
resource_group_name = data.azurerm_resource_group.main[0].name
version = var.server_version
administrator_login = local.database_username
administrator_password = local.database_password
create_mode = "Default"
storage_mb = var.azure_storage_mb
sku_name = var.azure_sku_name
delegated_subnet_id = data.azurerm_subnet.main[0].id
private_dns_zone_id = data.azurerm_private_dns_zone.main[0].id
name = local.azure_name
location = data.azurerm_resource_group.main[0].location
resource_group_name = data.azurerm_resource_group.main[0].name
version = var.server_version
administrator_login = local.database_username
administrator_password = local.database_password
create_mode = "Default"
storage_mb = var.azure_storage_mb
sku_name = var.azure_sku_name
delegated_subnet_id = data.azurerm_subnet.main[0].id
private_dns_zone_id = data.azurerm_private_dns_zone.main[0].id
public_network_access_enabled = false

dynamic "high_availability" {
for_each = var.azure_enable_high_availability ? [1] : []
Expand All @@ -85,8 +86,7 @@ resource "azurerm_postgresql_flexible_server" "main" {
# Allow Azure to manage primary and standby server on fail-over. Ignore changes.
high_availability[0].standby_availability_zone,
# Required for import because of https://github.com/hashicorp/terraform-provider-azurerm/issues/15586
create_mode,
public_network_access_enabled
create_mode
]
}
}
Expand Down

0 comments on commit 780680a

Please sign in to comment.