{"id":22423846,"url":"https://github.com/statcan/terraform-azurerm-flex-postgresql","last_synced_at":"2026-05-17T00:10:45.163Z","repository":{"id":40664759,"uuid":"399586653","full_name":"StatCan/terraform-azurerm-flex-postgresql","owner":"StatCan","description":"Terraform module to deploy a managed PostgreSQL Flexible server on Azure","archived":false,"fork":false,"pushed_at":"2024-10-28T15:44:36.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T10:44:04.109Z","etag":null,"topics":["azure","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StatCan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-24T19:47:16.000Z","updated_at":"2024-10-28T15:43:39.000Z","dependencies_parsed_at":"2024-03-13T17:00:16.051Z","dependency_job_id":null,"html_url":"https://github.com/StatCan/terraform-azurerm-flex-postgresql","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Fterraform-azurerm-flex-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Fterraform-azurerm-flex-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Fterraform-azurerm-flex-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatCan%2Fterraform-azurerm-flex-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StatCan","download_url":"https://codeload.github.com/StatCan/terraform-azurerm-flex-postgresql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791929,"owners_count":20672669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","terraform"],"created_at":"2024-12-05T18:13:15.955Z","updated_at":"2026-05-17T00:10:45.139Z","avatar_url":"https://github.com/StatCan.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform for Azure Managed Database PostgreSQL Flexible Server\n\nCreates a PostgreSQL instance using the Azure Database for PostgreSQL - Flexible Server.\n\n## Usage\n\nExamples for this module along with various configurations can be found in the [examples/](examples/) folder.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | ~\u003e 1.5.7 |\n| \u003ca name=\"requirement_azurerm\"\u003e\u003c/a\u003e [azurerm](#requirement\\_azurerm) | ~\u003e 4.26 |\n| \u003ca name=\"requirement_postgresql\"\u003e\u003c/a\u003e [postgresql](#requirement\\_postgresql) | ~\u003e 1.25.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_azurerm\"\u003e\u003c/a\u003e [azurerm](#provider\\_azurerm) | 4.40.0 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_enc_key_vault\"\u003e\u003c/a\u003e [enc\\_key\\_vault](#module\\_enc\\_key\\_vault) | git::https://gitlab.k8s.cloud.statcan.ca/cloudnative/platform/terraform/terraform-azure-key-vault.git | v5.0.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [azurerm_key_vault_access_policy.cmk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |\n| [azurerm_key_vault_access_policy.runner_manage_keys](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_access_policy) | resource |\n| [azurerm_key_vault_key.cmk](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key) | resource |\n| [azurerm_monitor_diagnostic_setting.postgresql_server](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting) | resource |\n| [azurerm_postgresql_flexible_server.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server) | resource |\n| [azurerm_postgresql_flexible_server_active_directory_administrator.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_active_directory_administrator) | resource |\n| [azurerm_postgresql_flexible_server_configuration.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_configuration) | resource |\n| [azurerm_postgresql_flexible_server_database.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_database) | resource |\n| [azurerm_postgresql_flexible_server_firewall_rule.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_flexible_server_firewall_rule) | resource |\n| [azurerm_storage_account.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account) | resource |\n| [azurerm_storage_container.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container) | resource |\n| [azurerm_user_assigned_identity.pgsql](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/user_assigned_identity) | resource |\n| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |\n| [azurerm_key_vault.pointer](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault) | data source |\n| [azurerm_key_vault_secret.pointer_sqladmin_password](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/key_vault_secret) | data source |\n| [azurerm_monitor_diagnostic_categories.postgresql_server](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/monitor_diagnostic_categories) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_active_directory_administrator\"\u003e\u003c/a\u003e [active\\_directory\\_administrator](#input\\_active\\_directory\\_administrator) | n/a | \u003cpre\u003elist(object({\u003cbr/\u003e    object_id      = optional(string)\u003cbr/\u003e    principal_name = optional(string)\u003cbr/\u003e    principal_type = optional(string, \"Group\")\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_administrator_login\"\u003e\u003c/a\u003e [administrator\\_login](#input\\_administrator\\_login) | The Administrator Login for the PostgreSQL Flexible Server. | `string` | n/a | yes |\n| \u003ca name=\"input_administrator_password\"\u003e\u003c/a\u003e [administrator\\_password](#input\\_administrator\\_password) | The Password associated with the administrator\\_login for the PostgreSQL Flexible Server. | `string` | n/a | yes |\n| \u003ca name=\"input_databases\"\u003e\u003c/a\u003e [databases](#input\\_databases) | The name, collation, and charset of the PostgreSQL database(s). (defaults: charset='utf8', collation='en\\_US.utf8') | `map(map(string))` | n/a | yes |\n| \u003ca name=\"input_delegated_subnet_id\"\u003e\u003c/a\u003e [delegated\\_subnet\\_id](#input\\_delegated\\_subnet\\_id) | The subnet where you want the database created. The subnet must be delegated to Microsoft.DBforPostgreSQL/flexibleServers. | `string` | `null` | no |\n| \u003ca name=\"input_diagnostics\"\u003e\u003c/a\u003e [diagnostics](#input\\_diagnostics) | Diagnostic settings for those resources that support it. | \u003cpre\u003eobject({\u003cbr/\u003e    destination   = string\u003cbr/\u003e    eventhub_name = string\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_environment\"\u003e\u003c/a\u003e [environment](#input\\_environment) | The environment used for keyvault access. | `string` | n/a | yes |\n| \u003ca name=\"input_firewall_rules\"\u003e\u003c/a\u003e [firewall\\_rules](#input\\_firewall\\_rules) | Specifies the Start IP Address associated with this Firewall Rule. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_geo_redundant_backup_enabled\"\u003e\u003c/a\u003e [geo\\_redundant\\_backup\\_enabled](#input\\_geo\\_redundant\\_backup\\_enabled) | Is Geo-Redundant backup enabled on the PostgreSQL Flexible Server. | `bool` | `false` | no |\n| \u003ca name=\"input_ip_rules\"\u003e\u003c/a\u003e [ip\\_rules](#input\\_ip\\_rules) | List of public IP or IP ranges in CIDR Format. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_kv_pointer_enable\"\u003e\u003c/a\u003e [kv\\_pointer\\_enable](#input\\_kv\\_pointer\\_enable) | Flag kv\\_pointer\\_enable can either be `true` (state from key vault), or `false` (state from terraform). | `bool` | `false` | no |\n| \u003ca name=\"input_kv_pointer_name\"\u003e\u003c/a\u003e [kv\\_pointer\\_name](#input\\_kv\\_pointer\\_name) | The key vault name to be used when kv\\_pointer\\_enable is set to `true`. | `string` | `null` | no |\n| \u003ca name=\"input_kv_pointer_rg\"\u003e\u003c/a\u003e [kv\\_pointer\\_rg](#input\\_kv\\_pointer\\_rg) | The key vault resource group to be used when kv\\_pointer\\_enable is set to `true`. | `string` | `null` | no |\n| \u003ca name=\"input_kv_pointer_sqladmin_password\"\u003e\u003c/a\u003e [kv\\_pointer\\_sqladmin\\_password](#input\\_kv\\_pointer\\_sqladmin\\_password) | The sqladmin password to be looked up in key vault when kv\\_pointer\\_enable is set to `true`. | `string` | `null` | no |\n| \u003ca name=\"input_kv_private_endpoints\"\u003e\u003c/a\u003e [kv\\_private\\_endpoints](#input\\_kv\\_private\\_endpoints) | The information required to create a private endpoint for the Key Vault. | \u003cpre\u003elist(object({\u003cbr/\u003e    sub_resource_name   = optional(string, \"vault\")\u003cbr/\u003e    subnet_id           = string\u003cbr/\u003e    private_dns_zone_id = string\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_kv_public_network_access_enabled\"\u003e\u003c/a\u003e [kv\\_public\\_network\\_access\\_enabled](#input\\_kv\\_public\\_network\\_access\\_enabled) | (Required) Whether or not public network access is allowed. | `bool` | `false` | no |\n| \u003ca name=\"input_kv_subnet_ids\"\u003e\u003c/a\u003e [kv\\_subnet\\_ids](#input\\_kv\\_subnet\\_ids) | The subnets for the key vault. | `list(string)` | `null` | no |\n| \u003ca name=\"input_location\"\u003e\u003c/a\u003e [location](#input\\_location) | Specifies the supported Azure location where the resource exists. | `string` | `\"canadacentral\"` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | The name of the PostgreSQL Flexible Server. | `string` | n/a | yes |\n| \u003ca name=\"input_pgsql_version\"\u003e\u003c/a\u003e [pgsql\\_version](#input\\_pgsql\\_version) | The version of the PostgreSQL Flexible Server. Currently supported versions 13, 14, 15, 16, or 17. | `string` | `\"17\"` | no |\n| \u003ca name=\"input_postgresql_configurations\"\u003e\u003c/a\u003e [postgresql\\_configurations](#input\\_postgresql\\_configurations) | n/a | `map(string)` | \u003cpre\u003e{\u003cbr/\u003e  \"azure.extensions\": \"POSTGIS,PGCRYPTO\",\u003cbr/\u003e  \"checkpoint_warning\": \"0\",\u003cbr/\u003e  \"client_min_messages\": \"log\",\u003cbr/\u003e  \"connection_throttle.enable\": \"on\",\u003cbr/\u003e  \"debug_pretty_print\": \"on\",\u003cbr/\u003e  \"debug_print_parse\": \"off\",\u003cbr/\u003e  \"debug_print_plan\": \"off\",\u003cbr/\u003e  \"debug_print_rewritten\": \"off\",\u003cbr/\u003e  \"log_checkpoints\": \"on\",\u003cbr/\u003e  \"log_duration\": \"off\",\u003cbr/\u003e  \"log_error_verbosity\": \"verbose\",\u003cbr/\u003e  \"log_line_prefix\": \"%m [%p] %q[user=%u,db=%d,app=%a,client=%h] \",\u003cbr/\u003e  \"log_lock_waits\": \"off\",\u003cbr/\u003e  \"log_min_duration_statement\": \"10\",\u003cbr/\u003e  \"log_min_error_statement\": \"error\",\u003cbr/\u003e  \"log_min_messages\": \"warning\",\u003cbr/\u003e  \"log_statement\": \"ddl\",\u003cbr/\u003e  \"maintenance_work_mem\": \"32000\",\u003cbr/\u003e  \"max_wal_size\": \"512\",\u003cbr/\u003e  \"min_wal_size\": \"512\",\u003cbr/\u003e  \"pg_qs.query_capture_mode\": \"top\",\u003cbr/\u003e  \"pg_qs.track_utility\": \"off\",\u003cbr/\u003e  \"pg_stat_statements.track_utility\": \"off\",\u003cbr/\u003e  \"pgaudit.log\": \"ddl\",\u003cbr/\u003e  \"pgms_wait_sampling.query_capture_mode\": \"all\",\u003cbr/\u003e  \"row_security\": \"on\",\u003cbr/\u003e  \"temp_buffers\": \"16384\",\u003cbr/\u003e  \"wal_buffers\": \"8192\",\u003cbr/\u003e  \"wal_writer_delay\": \"200\",\u003cbr/\u003e  \"wal_writer_flush_after\": \"128\",\u003cbr/\u003e  \"work_mem\": \"2048000\"\u003cbr/\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_private_dns_zone_id\"\u003e\u003c/a\u003e [private\\_dns\\_zone\\_id](#input\\_private\\_dns\\_zone\\_id) | The ID of the private DNS zone to create the PostgreSQL Flexible Server. The private DNS zone must end with the suffix .postgres.database.azure.com. | `string` | `null` | no |\n| \u003ca name=\"input_project\"\u003e\u003c/a\u003e [project](#input\\_project) | Name of client project | `string` | n/a | yes |\n| \u003ca name=\"input_public_network_access_enabled\"\u003e\u003c/a\u003e [public\\_network\\_access\\_enabled](#input\\_public\\_network\\_access\\_enabled) | (Optional) Specifies whether this PostgreSQL Flexible Server is publicly accessible. | `bool` | `false` | no |\n| \u003ca name=\"input_resource_group_name\"\u003e\u003c/a\u003e [resource\\_group\\_name](#input\\_resource\\_group\\_name) | The name of the resource group in which to create the PostgreSQL Flexible Server. | `string` | n/a | yes |\n| \u003ca name=\"input_sa_create_log\"\u003e\u003c/a\u003e [sa\\_create\\_log](#input\\_sa\\_create\\_log) | Creates a storage account to be used for diagnostics logging of the PostgreSQL database created if the variable is set to `true`. | `bool` | `false` | no |\n| \u003ca name=\"input_sa_subnet_ids\"\u003e\u003c/a\u003e [sa\\_subnet\\_ids](#input\\_sa\\_subnet\\_ids) | The subnets for the storage account. | `list(string)` | `null` | no |\n| \u003ca name=\"input_sku_name\"\u003e\u003c/a\u003e [sku\\_name](#input\\_sku\\_name) | Specifies the SKU Name for this PostgreSQL Flexible Server. | `string` | `\"GP_Standard_D4ds_v4\"` | no |\n| \u003ca name=\"input_storage_account_name\"\u003e\u003c/a\u003e [storage\\_account\\_name](#input\\_storage\\_account\\_name) | Name of the storage account used for diagnostics (optional, if not provided the name is auto-generated). | `string` | `null` | no |\n| \u003ca name=\"input_storagesize_mb\"\u003e\u003c/a\u003e [storagesize\\_mb](#input\\_storagesize\\_mb) | Specifies the storage size in MB for the PostgreSQL Flexible Server. | `number` | `262144` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | A mapping of tags to assign to the resource. | `map(string)` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_administrator_login\"\u003e\u003c/a\u003e [administrator\\_login](#output\\_administrator\\_login) | n/a |\n| \u003ca name=\"output_fqdn\"\u003e\u003c/a\u003e [fqdn](#output\\_fqdn) | n/a |\n| \u003ca name=\"output_id\"\u003e\u003c/a\u003e [id](#output\\_id) | n/a |\n\u003c!-- END_TF_DOCS --\u003e\n\n## History\n\n[Change Log](./CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatcan%2Fterraform-azurerm-flex-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatcan%2Fterraform-azurerm-flex-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatcan%2Fterraform-azurerm-flex-postgresql/lists"}