{"id":15156457,"url":"https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql","last_synced_at":"2026-04-01T19:40:29.998Z","repository":{"id":103729932,"uuid":"595577437","full_name":"terraform-ibm-modules/terraform-ibm-icd-postgresql","owner":"terraform-ibm-modules","description":"Implements an instance of the IBM Cloud Databases for PostgreSQL service.","archived":false,"fork":false,"pushed_at":"2026-03-15T00:14:53.000Z","size":1719,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":15,"default_branch":"main","last_synced_at":"2026-03-15T11:36:25.445Z","etag":null,"topics":["core-team","deployable-architecture","graduated","ibm-cloud","postgresql","supported","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-ibm-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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":"2023-01-31T11:24:58.000Z","updated_at":"2026-03-15T11:30:16.000Z","dependencies_parsed_at":"2023-09-26T17:58:41.717Z","dependency_job_id":"a5cceeee-6d98-45fe-8401-d05a019fbede","html_url":"https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql","commit_stats":{"total_commits":462,"total_committers":25,"mean_commits":18.48,"dds":"0.22077922077922074","last_synced_commit":"68cd6c73e623926ebeb65ff9423b3ce4688b96c2"},"previous_names":[],"tags_count":279,"template":false,"template_full_name":"terraform-ibm-modules/terraform-ibm-module-template","purl":"pkg:github/terraform-ibm-modules/terraform-ibm-icd-postgresql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-icd-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-icd-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-icd-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-icd-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-ibm-modules","download_url":"https://codeload.github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-icd-postgresql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"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":["core-team","deployable-architecture","graduated","ibm-cloud","postgresql","supported","terraform","terraform-module"],"created_at":"2024-09-26T19:21:43.195Z","updated_at":"2026-04-01T19:40:29.987Z","avatar_url":"https://github.com/terraform-ibm-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBM Cloud Databases for Postgresql module\n\n[![Graduated (Supported)](https://img.shields.io/badge/Status-Graduated%20(Supported)-brightgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-icd-postgresql?logo=GitHub\u0026sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/releases/latest)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Terraform Registry](https://img.shields.io/badge/terraform-registry-623CE4?logo=terraform)](https://registry.terraform.io/modules/terraform-ibm-modules/icd-postgresql/ibm/latest)\n\nThis module implements an instance of the IBM Cloud Databases for PostgreSQL service.\n\n:exclamation: The module does not support major version upgrades or updates to encryption and backup encryption keys. To upgrade the version, create another instance of Databases for PostgreSQL with the updated version and follow the steps in [Upgrading PostgreSQL docs](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-upgrading\u0026interface=cli) in the IBM Cloud Docs.\n\n:exclamation: The module only supports setting the disk encryption and backup encryption key CRNs on creation and no update support is available. The KMS manual or automatic key rotation may be used to change the key value and initiate the re-encryption of the deployment.\n\n\u003c!-- BEGIN OVERVIEW HOOK --\u003e\n## Overview\n* [terraform-ibm-icd-postgresql](#terraform-ibm-icd-postgresql)\n* [Submodules](./modules)\n    * [fscloud](./modules/fscloud)\n* [Examples](./examples)\n:information_source: Ctrl/Cmd+Click or right-click on the Schematics deploy button to open in a new tab\n    * \u003ca href=\"./examples/backup\"\u003eRestore from backup example\u003c/a\u003e \u003ca href=\"https://cloud.ibm.com/schematics/workspaces/create?workspace_name=icd-postgresql-backup-example\u0026repository=https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tree/main/examples/backup\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deploy%20with IBM%20Cloud%20Schematics-0f62fe?logo=ibm\u0026logoColor=white\u0026labelColor=0f62fe\" alt=\"Deploy with IBM Cloud Schematics\" style=\"height: 16px; vertical-align: text-bottom; margin-left: 5px;\"\u003e\u003c/a\u003e\n    * \u003ca href=\"./examples/basic\"\u003eBasic with read-only replica example\u003c/a\u003e \u003ca href=\"https://cloud.ibm.com/schematics/workspaces/create?workspace_name=icd-postgresql-basic-example\u0026repository=https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tree/main/examples/basic\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deploy%20with IBM%20Cloud%20Schematics-0f62fe?logo=ibm\u0026logoColor=white\u0026labelColor=0f62fe\" alt=\"Deploy with IBM Cloud Schematics\" style=\"height: 16px; vertical-align: text-bottom; margin-left: 5px;\"\u003e\u003c/a\u003e\n    * \u003ca href=\"./examples/complete\"\u003eComplete example with BYOK encryption, CBR rules and VPE creation\u003c/a\u003e \u003ca href=\"https://cloud.ibm.com/schematics/workspaces/create?workspace_name=icd-postgresql-complete-example\u0026repository=https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tree/main/examples/complete\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deploy%20with IBM%20Cloud%20Schematics-0f62fe?logo=ibm\u0026logoColor=white\u0026labelColor=0f62fe\" alt=\"Deploy with IBM Cloud Schematics\" style=\"height: 16px; vertical-align: text-bottom; margin-left: 5px;\"\u003e\u003c/a\u003e\n    * \u003ca href=\"./examples/fscloud\"\u003eFinancial Services Cloud profile example with autoscaling enabled\u003c/a\u003e \u003ca href=\"https://cloud.ibm.com/schematics/workspaces/create?workspace_name=icd-postgresql-fscloud-example\u0026repository=https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tree/main/examples/fscloud\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deploy%20with IBM%20Cloud%20Schematics-0f62fe?logo=ibm\u0026logoColor=white\u0026labelColor=0f62fe\" alt=\"Deploy with IBM Cloud Schematics\" style=\"height: 16px; vertical-align: text-bottom; margin-left: 5px;\"\u003e\u003c/a\u003e\n    * \u003ca href=\"./examples/pitr\"\u003ePoint in time recovery example (PITR)\u003c/a\u003e \u003ca href=\"https://cloud.ibm.com/schematics/workspaces/create?workspace_name=icd-postgresql-pitr-example\u0026repository=https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql/tree/main/examples/pitr\"\u003e\u003cimg src=\"https://img.shields.io/badge/Deploy%20with IBM%20Cloud%20Schematics-0f62fe?logo=ibm\u0026logoColor=white\u0026labelColor=0f62fe\" alt=\"Deploy with IBM Cloud Schematics\" style=\"height: 16px; vertical-align: text-bottom; margin-left: 5px;\"\u003e\u003c/a\u003e\n* [Deployable Architectures](./solutions)\n    * \u003ca href=\"./solutions/fully-configurable\"\u003eCloud automation for PostgreSQL (Fully configurable)\u003c/a\u003e\n    * \u003ca href=\"./solutions/security-enforced\"\u003eCloud automation for PostgreSQL (Security enforced)\u003c/a\u003e\n* [Contributing](#contributing)\n\u003c!-- END OVERVIEW HOOK --\u003e\n\n## terraform-ibm-icd-postgresql\n\n### Usage\n\nIBM Cloud Databases supports:\n- Key Protect encryption in `us-south`, `us-east`, and `eu-de` for backup encryption. For more information, see [Bring Your Own Key for Backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect\u0026interface=ui#key-byok) in the IBM Cloud Docs.\n- Hyper Protect Crypto Services in all regions for backup encryption. For more information, see [Hyper Protect Crypto Services for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups) in the IBM Cloud Docs.\n\nIf you enable key management encryption and no value is passed for 'backup_encryption_key_crn', the value of 'kms_key_crn' is used\n\n```hcl\nprovider \"ibm\" {\n  ibmcloud_api_key = \"XXXXXXXXXX\"\n  region           = \"us-south\"\n}\n\nmodule \"postgresql_db\" {\n  source            = \"terraform-ibm-modules/icd-postgresql/ibm\"\n  version           = \"latest\" # Replace \"latest\" with a release version to lock into a specific release\n  resource_group_id = \"xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX\"\n  name              = \"my-instance\"\n  region            = \"us-south\"\n}\n```\n\n## Required IAM access policies\n\nYou need the following permissions to run this module.\n\n- Account Management\n    - **Databases for PostgreSQL** service\n        - `Editor` role access\n\nTo attach access management tags to resources in this module, you need the following permissions.\n\n- IAM Services\n    - **Tagging** service\n        - `Administrator` platform access\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n### Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.9.0 |\n| \u003ca name=\"requirement_ibm\"\u003e\u003c/a\u003e [ibm](#requirement\\_ibm) | \u003e= 1.87.3, \u003c2.0.0 |\n| \u003ca name=\"requirement_time\"\u003e\u003c/a\u003e [time](#requirement\\_time) | \u003e= 0.9.1, \u003c 1.0.0 |\n\n### Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_available_versions\"\u003e\u003c/a\u003e [available\\_versions](#module\\_available\\_versions) | terraform-ibm-modules/common-utilities/ibm//modules/icd-versions | 1.4.2 |\n| \u003ca name=\"module_backup_key_crn_parser\"\u003e\u003c/a\u003e [backup\\_key\\_crn\\_parser](#module\\_backup\\_key\\_crn\\_parser) | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.4.2 |\n| \u003ca name=\"module_cbr_rule\"\u003e\u003c/a\u003e [cbr\\_rule](#module\\_cbr\\_rule) | terraform-ibm-modules/cbr/ibm//modules/cbr-rule-module | 1.35.19 |\n| \u003ca name=\"module_kms_key_crn_parser\"\u003e\u003c/a\u003e [kms\\_key\\_crn\\_parser](#module\\_kms\\_key\\_crn\\_parser) | terraform-ibm-modules/common-utilities/ibm//modules/crn-parser | 1.4.2 |\n\n### Resources\n\n| Name | Type |\n|------|------|\n| [ibm_database.postgresql_db](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database) | resource |\n| [ibm_iam_authorization_policy.backup_kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |\n| [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |\n| [ibm_resource_key.service_credentials](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_key) | resource |\n| [ibm_resource_tag.access_tag](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) | resource |\n| [time_sleep.wait_for_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |\n| [time_sleep.wait_for_backup_kms_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |\n| [ibm_database_connection.database_connection](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/database_connection) | data source |\n| [ibm_database_point_in_time_recovery.source_db_earliest_pitr_time](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/database_point_in_time_recovery) | data source |\n\n### Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_access_tags\"\u003e\u003c/a\u003e [access\\_tags](#input\\_access\\_tags) | A list of access tags to apply to the PostgreSQL instance created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details | `list(string)` | `[]` | no |\n| \u003ca name=\"input_admin_pass\"\u003e\u003c/a\u003e [admin\\_pass](#input\\_admin\\_pass) | The password for the database administrator. If the admin password is null then the admin user ID cannot be accessed. More users can be specified in a user block. | `string` | `null` | no |\n| \u003ca name=\"input_async_restore\"\u003e\u003c/a\u003e [async\\_restore](#input\\_async\\_restore) | Set it to `true`, to initiate the restore as an asynchronous operation, which helps to reduce end-to-end restore time. This feature can only be used when the source and target PostgreSQL databases are running the same major version. | `bool` | `false` | no |\n| \u003ca name=\"input_auto_scaling\"\u003e\u003c/a\u003e [auto\\_scaling](#input\\_auto\\_scaling) | Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. See https://ibm.biz/autoscaling-considerations in the IBM Cloud Docs. | \u003cpre\u003eobject({\u003cbr/\u003e    disk = object({\u003cbr/\u003e      capacity_enabled             = optional(bool, false)\u003cbr/\u003e      free_space_less_than_percent = optional(number, 10)\u003cbr/\u003e      io_above_percent             = optional(number, 90)\u003cbr/\u003e      io_enabled                   = optional(bool, false)\u003cbr/\u003e      io_over_period               = optional(string, \"15m\")\u003cbr/\u003e      rate_increase_percent        = optional(number, 10)\u003cbr/\u003e      rate_limit_mb_per_member     = optional(number, 3670016)\u003cbr/\u003e      rate_period_seconds          = optional(number, 900)\u003cbr/\u003e      rate_units                   = optional(string, \"mb\")\u003cbr/\u003e    })\u003cbr/\u003e    memory = object({\u003cbr/\u003e      io_above_percent         = optional(number, 90)\u003cbr/\u003e      io_enabled               = optional(bool, false)\u003cbr/\u003e      io_over_period           = optional(string, \"15m\")\u003cbr/\u003e      rate_increase_percent    = optional(number, 10)\u003cbr/\u003e      rate_limit_mb_per_member = optional(number, 114688)\u003cbr/\u003e      rate_period_seconds      = optional(number, 900)\u003cbr/\u003e      rate_units               = optional(string, \"mb\")\u003cbr/\u003e    })\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_backup_crn\"\u003e\u003c/a\u003e [backup\\_crn](#input\\_backup\\_crn) | The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after provisioning and the new deployment starts up that uses that data. A backup CRN is in the format crn:v1:\u003c…\u003e:backup:. If omitted, the database is provisioned empty. | `string` | `null` | no |\n| \u003ca name=\"input_backup_encryption_key_crn\"\u003e\u003c/a\u003e [backup\\_encryption\\_key\\_crn](#input\\_backup\\_encryption\\_key\\_crn) | The CRN of a Key Protect or Hyper Protect Crypto Services encryption key that you want to use for encrypting the disk that holds deployment backups. Applies only if `use_ibm_owned_encryption_key` is false and `use_same_kms_key_for_backups` is false. If no value is passed, and `use_same_kms_key_for_backups` is true, the value of `kms_key_crn` is used. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect\u0026interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups). | `string` | `null` | no |\n| \u003ca name=\"input_cbr_rules\"\u003e\u003c/a\u003e [cbr\\_rules](#input\\_cbr\\_rules) | The context-based restrictions rule to create. Only one rule is allowed. | \u003cpre\u003elist(object({\u003cbr/\u003e    description = string\u003cbr/\u003e    account_id  = string\u003cbr/\u003e    rule_contexts = list(object({\u003cbr/\u003e      attributes = optional(list(object({\u003cbr/\u003e        name  = string\u003cbr/\u003e        value = string\u003cbr/\u003e    }))) }))\u003cbr/\u003e    enforcement_mode = string\u003cbr/\u003e    tags = optional(list(object({\u003cbr/\u003e      name  = string\u003cbr/\u003e      value = string\u003cbr/\u003e    })))\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_configuration\"\u003e\u003c/a\u003e [configuration](#input\\_configuration) | Database configuration parameters, see https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-changing-configuration\u0026interface=api for more details. | \u003cpre\u003eobject({\u003cbr/\u003e    shared_buffers  = optional(number)\u003cbr/\u003e    max_connections = optional(number)\u003cbr/\u003e    # below field gives error when sent to provider\u003cbr/\u003e    # tracking issue: https://github.com/IBM-Cloud/terraform-provider-ibm/issues/5403\u003cbr/\u003e    # max_locks_per_transaction  = optional(number)\u003cbr/\u003e    max_prepared_transactions  = optional(number)\u003cbr/\u003e    synchronous_commit         = optional(string)\u003cbr/\u003e    effective_io_concurrency   = optional(number)\u003cbr/\u003e    deadlock_timeout           = optional(number)\u003cbr/\u003e    log_connections            = optional(string)\u003cbr/\u003e    log_disconnections         = optional(string)\u003cbr/\u003e    log_min_duration_statement = optional(number)\u003cbr/\u003e    tcp_keepalives_idle        = optional(number)\u003cbr/\u003e    tcp_keepalives_interval    = optional(number)\u003cbr/\u003e    tcp_keepalives_count       = optional(number)\u003cbr/\u003e    archive_timeout            = optional(number)\u003cbr/\u003e    wal_level                  = optional(string)\u003cbr/\u003e    max_replication_slots      = optional(number)\u003cbr/\u003e    max_wal_senders            = optional(number)\u003cbr/\u003e  })\u003c/pre\u003e | `null` | no |\n| \u003ca name=\"input_cpu_count\"\u003e\u003c/a\u003e [cpu\\_count](#input\\_cpu\\_count) | Allocated dedicated CPU per member. For shared CPU, set to 0. [Learn more](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-resources-scaling) | `number` | `0` | no |\n| \u003ca name=\"input_create_timeout\"\u003e\u003c/a\u003e [create\\_timeout](#input\\_create\\_timeout) | A database creation may require a longer timeout for the creation to complete. The default is 120 minutes. Set this variable to change the `create` value in the `timeouts` block. [Learn more](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts). | `string` | `\"120m\"` | no |\n| \u003ca name=\"input_delete_timeout\"\u003e\u003c/a\u003e [delete\\_timeout](#input\\_delete\\_timeout) | A database deletion may require a longer timeout for the deletion to complete. The default is 15 minutes. Set this variable to change the `delete` value in the `timeouts` block. [Learn more](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts). | `string` | `\"15m\"` | no |\n| \u003ca name=\"input_deletion_protection\"\u003e\u003c/a\u003e [deletion\\_protection](#input\\_deletion\\_protection) | Enable deletion protection within terraform. This is not a property of the resource and does not prevent deletion outside of terraform. The database can not be deleted by terraform when this value is set to 'true'. In order to delete with terraform the value must be set to 'false' and a terraform apply performed before the destroy is performed. The default is 'true'. | `bool` | `true` | no |\n| \u003ca name=\"input_disk_mb\"\u003e\u003c/a\u003e [disk\\_mb](#input\\_disk\\_mb) | Allocated disk per member. [Learn more](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-resources-scaling) | `number` | `5120` | no |\n| \u003ca name=\"input_kms_key_crn\"\u003e\u003c/a\u003e [kms\\_key\\_crn](#input\\_kms\\_key\\_crn) | The CRN of a Key Protect or Hyper Protect Crypto Services encryption key to encrypt your data. Applies only if `use_ibm_owned_encryption_key` is false. By default this key is used for both deployment data and backups, but this behaviour can be altered using the `use_same_kms_key_for_backups` and `backup_encryption_key_crn` inputs. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect\u0026interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups). | `string` | `null` | no |\n| \u003ca name=\"input_member_host_flavor\"\u003e\u003c/a\u003e [member\\_host\\_flavor](#input\\_member\\_host\\_flavor) | Allocated host flavor per member. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/database#host_flavor). | `string` | `null` | no |\n| \u003ca name=\"input_members\"\u003e\u003c/a\u003e [members](#input\\_members) | Allocated number of members. Members can be scaled up but not down. | `number` | `2` | no |\n| \u003ca name=\"input_memory_mb\"\u003e\u003c/a\u003e [memory\\_mb](#input\\_memory\\_mb) | Allocated memory per member. [Learn more](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-resources-scaling) | `number` | `4096` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | The name to give the Postgresql instance. | `string` | n/a | yes |\n| \u003ca name=\"input_pitr_id\"\u003e\u003c/a\u003e [pitr\\_id](#input\\_pitr\\_id) | (Optional) The ID of the source deployment PostgreSQL instance that you want to recover back to. The PostgreSQL instance is expected to be in an up and in running state. | `string` | `null` | no |\n| \u003ca name=\"input_pitr_time\"\u003e\u003c/a\u003e [pitr\\_time](#input\\_pitr\\_time) | (Optional) The timestamp in UTC format (%Y-%m-%dT%H:%M:%SZ) for any time in the last 7 days that you want to restore to. If empty string (\"\") is passed, earliest\\_point\\_in\\_time\\_recovery\\_time will be used as pitr\\_time. To retrieve the timestamp, run the command (ibmcloud cdb postgresql earliest-pitr-timestamp \u003cdeployment name or CRN\u003e). For more info on Point-in-time Recovery, see https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-pitr | `string` | `null` | no |\n| \u003ca name=\"input_postgresql_version\"\u003e\u003c/a\u003e [postgresql\\_version](#input\\_postgresql\\_version) | Version of the PostgreSQL instance. If no value is passed, the current preferred version of IBM Cloud Databases is used. | `string` | `null` | no |\n| \u003ca name=\"input_region\"\u003e\u003c/a\u003e [region](#input\\_region) | The region where you want to deploy your instance. | `string` | `\"us-south\"` | no |\n| \u003ca name=\"input_remote_leader_crn\"\u003e\u003c/a\u003e [remote\\_leader\\_crn](#input\\_remote\\_leader\\_crn) | A CRN of the leader database to make the replica(read-only) deployment. The leader database is created by a database deployment with the same service ID. A read-only replica is set up to replicate all of your data from the leader deployment to the replica deployment by using asynchronous replication. For more information, see https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-read-only-replicas | `string` | `null` | no |\n| \u003ca name=\"input_resource_group_id\"\u003e\u003c/a\u003e [resource\\_group\\_id](#input\\_resource\\_group\\_id) | The resource group ID where the PostgreSQL instance will be created. | `string` | n/a | yes |\n| \u003ca name=\"input_service_credential_names\"\u003e\u003c/a\u003e [service\\_credential\\_names](#input\\_service\\_credential\\_names) | List of service credentials to create for the database, including name and optionally role and endpoint type. | \u003cpre\u003elist(object({\u003cbr/\u003e    name     = string\u003cbr/\u003e    role     = optional(string, \"Viewer\")\u003cbr/\u003e    endpoint = optional(string, \"private\")\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_service_endpoints\"\u003e\u003c/a\u003e [service\\_endpoints](#input\\_service\\_endpoints) | Specify whether you want to enable the public, private, or both service endpoints. Supported values are 'public', 'private', or 'public-and-private'. | `string` | `\"private\"` | no |\n| \u003ca name=\"input_skip_iam_authorization_policy\"\u003e\u003c/a\u003e [skip\\_iam\\_authorization\\_policy](#input\\_skip\\_iam\\_authorization\\_policy) | Set to true to skip the creation of IAM authorization policies that permits all Databases for PostgreSQL instances in the given resource group 'Reader' access to the Key Protect or Hyper Protect Crypto Services key that was provided in the `kms_key_crn` and `backup_encryption_key_crn` inputs. This policy is required in order to enable KMS encryption, so only skip creation if there is one already present in your account. No policy is created if `use_ibm_owned_encryption_key` is true. | `bool` | `false` | no |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | Optional list of tags to be added to the PostgreSQL instance. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_update_timeout\"\u003e\u003c/a\u003e [update\\_timeout](#input\\_update\\_timeout) | A database update may require a longer timeout for the update to complete. The default is 120 minutes. Set this variable to change the `update` value in the `timeouts` block. [Learn more](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts). | `string` | `\"120m\"` | no |\n| \u003ca name=\"input_use_default_backup_encryption_key\"\u003e\u003c/a\u003e [use\\_default\\_backup\\_encryption\\_key](#input\\_use\\_default\\_backup\\_encryption\\_key) | When `use_ibm_owned_encryption_key` is set to false, backups will be encrypted with either the key specified in `kms_key_crn`, or in `backup_encryption_key_crn` if a value is passed. If you do not want to use your own key for backups encryption, you can set this to `true` to use the IBM Cloud Databases default encryption for backups. Alternatively set `use_ibm_owned_encryption_key` to true to use the default encryption for both backups and deployment data. | `bool` | `false` | no |\n| \u003ca name=\"input_use_ibm_owned_encryption_key\"\u003e\u003c/a\u003e [use\\_ibm\\_owned\\_encryption\\_key](#input\\_use\\_ibm\\_owned\\_encryption\\_key) | IBM Cloud Databases will secure your deployment's data at rest automatically with an encryption key that IBM hold. Alternatively, you may select your own Key Management System instance and encryption key (Key Protect or Hyper Protect Crypto Services) by setting this to false. If setting to false, a value must be passed for the `kms_key_crn` input. | `bool` | `true` | no |\n| \u003ca name=\"input_use_same_kms_key_for_backups\"\u003e\u003c/a\u003e [use\\_same\\_kms\\_key\\_for\\_backups](#input\\_use\\_same\\_kms\\_key\\_for\\_backups) | Set this to false if you wan't to use a different key that you own to encrypt backups. When set to false, a value is required for the `backup_encryption_key_crn` input. Alternatively set `use_default_backup_encryption_key` to true to use the IBM Cloud Databases default encryption. Applies only if `use_ibm_owned_encryption_key` is false. Bare in mind that backups encryption is only available in certain regions. See [Bring your own key for backups](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect\u0026interface=ui#key-byok) and [Using the HPCS Key for Backup encryption](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups). | `bool` | `true` | no |\n| \u003ca name=\"input_users\"\u003e\u003c/a\u003e [users](#input\\_users) | A list of users that you want to create on the database. Multiple blocks are allowed. The user password must be in the range of 10-32 characters. Be warned that in most case using IAM service credentials (via the var.service\\_credential\\_names) is sufficient to control access to the Postgres instance. This blocks creates native postgres database users, more info on that can be found here https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-user-management\u0026interface=ui | \u003cpre\u003elist(object({\u003cbr/\u003e    name     = string\u003cbr/\u003e    password = string # pragma: allowlist secret\u003cbr/\u003e    type     = optional(string)\u003cbr/\u003e    role     = optional(string)\u003cbr/\u003e  }))\u003c/pre\u003e | `[]` | no |\n| \u003ca name=\"input_version_upgrade_skip_backup\"\u003e\u003c/a\u003e [version\\_upgrade\\_skip\\_backup](#input\\_version\\_upgrade\\_skip\\_backup) | Whether to skip taking a backup before upgrading the database version. Attention: Skipping a backup is not recommended. Skipping a backup before a version upgrade is dangerous and may result in data loss if the upgrade fails at any stage — there will be no immediate backup to restore from. | `bool` | `false` | no |\n\n### Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_adminuser\"\u003e\u003c/a\u003e [adminuser](#output\\_adminuser) | Database admin user name |\n| \u003ca name=\"output_cbr_rule_ids\"\u003e\u003c/a\u003e [cbr\\_rule\\_ids](#output\\_cbr\\_rule\\_ids) | CBR rule ids created to restrict Postgresql |\n| \u003ca name=\"output_certificate_base64\"\u003e\u003c/a\u003e [certificate\\_base64](#output\\_certificate\\_base64) | Database connection certificate |\n| \u003ca name=\"output_crn\"\u003e\u003c/a\u003e [crn](#output\\_crn) | Postgresql instance crn |\n| \u003ca name=\"output_guid\"\u003e\u003c/a\u003e [guid](#output\\_guid) | Postgresql instance guid |\n| \u003ca name=\"output_hostname\"\u003e\u003c/a\u003e [hostname](#output\\_hostname) | Database connection hostname |\n| \u003ca name=\"output_id\"\u003e\u003c/a\u003e [id](#output\\_id) | Postgresql instance id |\n| \u003ca name=\"output_pitr_time\"\u003e\u003c/a\u003e [pitr\\_time](#output\\_pitr\\_time) | Postgresql instance id |\n| \u003ca name=\"output_port\"\u003e\u003c/a\u003e [port](#output\\_port) | Database connection port |\n| \u003ca name=\"output_service_credentials_json\"\u003e\u003c/a\u003e [service\\_credentials\\_json](#output\\_service\\_credentials\\_json) | Service credentials json map |\n| \u003ca name=\"output_service_credentials_object\"\u003e\u003c/a\u003e [service\\_credentials\\_object](#output\\_service\\_credentials\\_object) | Service credentials object |\n| \u003ca name=\"output_version\"\u003e\u003c/a\u003e [version](#output\\_version) | Postgresql instance version |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\u003c!-- BEGIN CONTRIBUTING HOOK --\u003e\n\n\u003c!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow --\u003e\n## Contributing\n\nYou can report issues and request features for this module in GitHub issues in the module repo. See [Report an issue or request a feature](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).\n\nTo set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.\n\u003c!-- Source for this readme file: https://github.com/terraform-ibm-modules/common-dev-assets/tree/main/module-assets/ci/module-template-automation --\u003e\n\u003c!-- END CONTRIBUTING HOOK --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-icd-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-icd-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-icd-postgresql/lists"}