WARNING: This module does not support major version upgrade or updates to encryption and backup encryption keys: To upgrade version create a new postgresql instance with the updated version and follow the Upgrading PostgreSQL docs
module "postgresql_db" { # replace main with version source = "git::https://github.com/terraform-ibm-modules/terraform-ibm-icd-postgresql?ref=main" admin_password = var.admin_password resource_group_id = module.resource_group.resource_group_id name = var.name }You need the following permissions to run this module.
- Account Management
- Databases for PostgreSQL service
Editorrole access
- Databases for PostgreSQL service
- Autoscale example
- Restore from backup example
- Complete example with byok encryption, CBR rules and storing credentials in secrets manager
- Default example
- Financial Services Cloud profile example
| Name | Version |
|---|---|
| terraform | >= 1.3.0 |
| ibm | >= 1.49.0 |
| Name | Source | Version |
|---|---|---|
| cbr_rule | git::https://github.com/terraform-ibm-modules/terraform-ibm-cbr//cbr-rule-module | v1.1.4 |
| Name | Type |
|---|---|
| ibm_database.postgresql_db | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| allowlist | Set of IP address and description to allowlist in database | list(object({ | [] | no |
| auto_scaling | (Optional) Configure rules to allow your database to automatically increase its resources. Single block of autoscaling is allowed at once. | object({ | { | no |
| 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:<…>:backup:. If omitted, the database is provisioned empty. | string | null | no |
| backup_encryption_key_crn | (Optional) The CRN of a key protect key, that you want to use for encrypting disk that holds deployment backups. If null, will use 'key_protect_key_crn' as encryption key. If 'key_protect_key_crn' is also null database is encrypted by using randomly generated keys. | string | null | no |
| cbr_rules | (Optional, list) List of CBR rules to create | list(object({ | [] | no |
| configuration | (Optional, Json String) Database Configuration in JSON format. | object({ | null | no |
| key_protect_key_crn | (Optional) The root key CRN of a Key Management Service like Key Protect or Hyper Protect Crypto Service (HPCS) that you want to use for disk encryption. If null, database is encrypted by using randomly generated keys. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok for current list of supported regions for BYOK | string | null | no |
| member_cpu_count | CPU allocation required for postgresql database | string | "3" | no |
| member_disk_mb | Disk allocation required for postgresql database | string | "5120" | no |
| member_memory_mb | Memory allocation required for postgresql database | string | "1024" | no |
| members | Number of members | number | 3 | no |
| name | Name of the Postgresql instance | string | n/a | yes |
| pg_version | Version of the postgresql instance | string | null | no |
| plan_validation | Enable or disable validating the database parameters for postgres during the plan phase | bool | true | no |
| region | The region postgresql is to be created on. The region must support BYOK if key_protect_key_crn is used | string | "us-south" | no |
| resource_group_id | The resource group ID where the postgresql will be created | string | n/a | yes |
| resource_tags | Optional list of tags to be added to created resources | list(string) | [] | no |
| service_endpoints | Sets the endpoint of the Postgresql instance, valid values are 'public', 'private', or 'public-and-private' | string | "private" | no |
| Name | Description |
|---|---|
| guid | Postgresql instance guid |
| id | Postgresql instance id |
| version | Postgresql instance version |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.