diff --git a/aks/postgres/resources.tf b/aks/postgres/resources.tf index ad20e2d..7129e02 100644 --- a/aks/postgres/resources.tf +++ b/aks/postgres/resources.tf @@ -96,6 +96,14 @@ resource "azurerm_postgresql_flexible_server_configuration" "max_connections" { value = 856 # Maximum on GP_Standard_D2ds_v4. See: https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-limits#maximum-connections } +resource "azurerm_postgresql_flexible_server_configuration" "connection_throttling" { + count = var.use_azure ? 1 : 0 + # Parameter connection_throttling = on enables temporary connection throttling per IP for too many login failures + name = "connection_throttle.enable" + server_id = azurerm_postgresql_flexible_server.main[0].id + value = "on" +} + resource "azurerm_postgresql_flexible_server_database" "main" { count = var.use_azure ? 1 : 0 diff --git a/aks/postgres/tfdocs.md b/aks/postgres/tfdocs.md index 0f6cde7..8010eda 100644 --- a/aks/postgres/tfdocs.md +++ b/aks/postgres/tfdocs.md @@ -25,6 +25,7 @@ No modules. | [azurerm_monitor_metric_alert.storage](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert) | resource | | [azurerm_postgresql_flexible_server.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server) | resource | | [azurerm_postgresql_flexible_server_configuration.azure_extensions](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_configuration) | resource | +| [azurerm_postgresql_flexible_server_configuration.connection_throttling](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_configuration) | resource | | [azurerm_postgresql_flexible_server_configuration.max_connections](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_configuration) | resource | | [azurerm_postgresql_flexible_server_database.main](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_database) | resource | | [azurerm_storage_account.backup](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account) | resource |