{"id":49540337,"url":"https://github.com/kogunlowo123/terraform-azure-postgresql-flexible","last_synced_at":"2026-05-02T15:05:03.979Z","repository":{"id":343203447,"uuid":"1175263127","full_name":"kogunlowo123/terraform-azure-postgresql-flexible","owner":"kogunlowo123","description":"Azure PostgreSQL Flexible Server Terraform module with HA, geo-redundant backups, and private endpoint","archived":false,"fork":false,"pushed_at":"2026-03-17T13:47:50.000Z","size":19,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T04:04:37.853Z","etag":null,"topics":["azure","database","devops","infrastructure-as-code","postgresql","production-ready","terraform","terraform-module"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kogunlowo123.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-07T13:20:00.000Z","updated_at":"2026-03-17T13:47:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kogunlowo123/terraform-azure-postgresql-flexible","commit_stats":null,"previous_names":["kogunlowo123/terraform-azure-postgresql-flexible"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kogunlowo123/terraform-azure-postgresql-flexible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kogunlowo123%2Fterraform-azure-postgresql-flexible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kogunlowo123%2Fterraform-azure-postgresql-flexible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kogunlowo123%2Fterraform-azure-postgresql-flexible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kogunlowo123%2Fterraform-azure-postgresql-flexible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kogunlowo123","download_url":"https://codeload.github.com/kogunlowo123/terraform-azure-postgresql-flexible/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kogunlowo123%2Fterraform-azure-postgresql-flexible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32538272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","database","devops","infrastructure-as-code","postgresql","production-ready","terraform","terraform-module"],"created_at":"2026-05-02T15:05:01.017Z","updated_at":"2026-05-02T15:05:03.974Z","avatar_url":"https://github.com/kogunlowo123.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-azure-postgresql-flexible\n\nTerraform module for deploying Azure Database for PostgreSQL Flexible Server with support for high availability, geo-redundant backups, read replicas, pgBouncer connection pooling, and private endpoint integration.\n\n## Architecture\n\n```mermaid\nflowchart TB\n    subgraph Server[\"PostgreSQL Flexible Server\"]\n        style Server fill:#0078D4,color:#fff\n        Primary[\"Primary Instance\"]\n        HA[\"High Availability\\n(Zone-Redundant)\"]\n        Configs[\"Server Configurations\\n(pgBouncer)\"]\n    end\n\n    subgraph Databases[\"Databases\"]\n        style Databases fill:#3F8624,color:#fff\n        DB1[\"Database 1\"]\n        DB2[\"Database N\"]\n    end\n\n    subgraph Security[\"Security\"]\n        style Security fill:#8C4FFF,color:#fff\n        FirewallRules[\"Firewall Rules\"]\n        ADAuth[\"Azure AD\\nAuthentication\"]\n        CMK[\"CMK Encryption\"]\n    end\n\n    subgraph Networking[\"Private Networking\"]\n        style Networking fill:#DD344C,color:#fff\n        DelegatedSubnet[\"Delegated Subnet\"]\n        PrivateDNS[\"Private DNS Zone\"]\n    end\n\n    subgraph Backup[\"Backup \u0026 Maintenance\"]\n        style Backup fill:#FF9900,color:#fff\n        GeoBackup[\"Geo-Redundant Backup\"]\n        AutoGrow[\"Storage Auto-Grow\"]\n        MaintenanceWin[\"Maintenance Window\"]\n    end\n\n    Server --\u003e Databases\n    Server --\u003e Security\n    Server --\u003e Networking\n    Server --\u003e Backup\n    Primary --\u003e HA\n    DelegatedSubnet --\u003e PrivateDNS\n```\n\n## Features\n\n- PostgreSQL Flexible Server with configurable SKU and storage\n- Zone-redundant and same-zone high availability\n- Geo-redundant backups with configurable retention (up to 35 days)\n- Storage auto-grow\n- pgBouncer connection pooling via server configurations\n- VNet integration with delegated subnet and private DNS zone\n- Multiple database creation\n- Server configuration management\n- Firewall rule management\n- Azure Active Directory authentication\n- Customer-managed key (CMK) encryption\n- Diagnostic settings for monitoring and threat detection\n- Maintenance window configuration\n\n## Usage\n\n### Basic\n\n```hcl\nmodule \"postgresql\" {\n  source = \"github.com/kogunlowo123/terraform-azure-postgresql-flexible\"\n\n  name                = \"my-psql-server\"\n  resource_group_name = \"my-resource-group\"\n  location            = \"East US\"\n  sku_name            = \"GP_Standard_D2s_v3\"\n  storage_mb          = 32768\n\n  administrator_login    = \"psqladmin\"\n  administrator_password = var.db_password\n\n  databases = {\n    mydb = {\n      charset   = \"UTF8\"\n      collation = \"en_US.utf8\"\n    }\n  }\n}\n```\n\n### With High Availability and pgBouncer\n\n```hcl\nmodule \"postgresql\" {\n  source = \"github.com/kogunlowo123/terraform-azure-postgresql-flexible\"\n\n  name                = \"my-psql-ha\"\n  resource_group_name = \"my-resource-group\"\n  location            = \"East US\"\n  sku_name            = \"GP_Standard_D4s_v3\"\n  storage_mb          = 65536\n  zone                = \"1\"\n\n  administrator_login    = \"psqladmin\"\n  administrator_password = var.db_password\n\n  high_availability = {\n    mode                      = \"ZoneRedundant\"\n    standby_availability_zone = \"2\"\n  }\n\n  server_configurations = {\n    \"pgbouncer.enabled\"           = \"true\"\n    \"pgbouncer.default_pool_size\" = \"50\"\n  }\n}\n```\n\n## Requirements\n\n| Name      | Version   |\n|-----------|-----------|\n| terraform | \u003e= 1.5.0  |\n| azurerm   | \u003e= 3.80.0 |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|----------|\n| name | The name of the PostgreSQL Flexible Server | `string` | n/a | yes |\n| resource_group_name | The name of the resource group | `string` | n/a | yes |\n| location | The Azure region | `string` | n/a | yes |\n| sku_name | The SKU name for the server | `string` | n/a | yes |\n| storage_mb | Max storage in megabytes | `number` | n/a | yes |\n| storage_tier | The storage tier | `string` | `null` | no |\n| postgresql_version | PostgreSQL version | `string` | `\"16\"` | no |\n| administrator_login | Administrator login | `string` | `null` | no |\n| administrator_password | Administrator password | `string` | `null` | no |\n| delegated_subnet_id | Delegated subnet ID for VNet integration | `string` | `null` | no |\n| private_dns_zone_id | Private DNS zone ID | `string` | `null` | no |\n| zone | Availability zone | `string` | `null` | no |\n| high_availability | HA configuration (mode, standby_availability_zone) | `object` | `null` | no |\n| backup_retention_days | Backup retention days (7-35) | `number` | `35` | no |\n| geo_redundant_backup_enabled | Enable geo-redundant backups | `bool` | `true` | no |\n| auto_grow_enabled | Enable storage auto-grow | `bool` | `true` | no |\n| databases | Map of databases to create | `map(object)` | `{}` | no |\n| server_configurations | Map of server configurations | `map(string)` | `{}` | no |\n| firewall_rules | Map of firewall rules | `map(object)` | `{}` | no |\n| enable_active_directory_auth | Enable AD authentication | `bool` | `false` | no |\n| ad_admin_object_id | AD admin object ID | `string` | `null` | no |\n| ad_admin_tenant_id | AD admin tenant ID | `string` | `null` | no |\n| customer_managed_key | CMK encryption configuration | `object` | `null` | no |\n| enable_threat_detection | Enable threat detection diagnostics | `bool` | `true` | no |\n| maintenance_window | Maintenance window configuration | `object` | `null` | no |\n| tags | Tags to assign to resources | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| server_id | The ID of the PostgreSQL Flexible Server |\n| server_name | The name of the server |\n| server_fqdn | The FQDN of the server |\n| server_location | The Azure region of the server |\n| server_version | The PostgreSQL version |\n| server_sku_name | The SKU name |\n| administrator_login | The administrator login |\n| database_ids | Map of database names to IDs |\n| firewall_rule_ids | Map of firewall rule names to IDs |\n| configuration_ids | Map of configuration names to IDs |\n| public_network_access_enabled | Whether public network access is enabled |\n\n## Examples\n\n- [Basic](./examples/basic/) - Simple deployment with public access\n- [Advanced](./examples/advanced/) - VNet integration, HA, pgBouncer\n- [Complete](./examples/complete/) - Full-featured with CMK, AD auth, diagnostics\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkogunlowo123%2Fterraform-azure-postgresql-flexible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkogunlowo123%2Fterraform-azure-postgresql-flexible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkogunlowo123%2Fterraform-azure-postgresql-flexible/lists"}