diff --git a/ibm_catalog.json b/ibm_catalog.json index 96e09d27..f2dec868 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -287,6 +287,9 @@ }, { "key": "backup_crn" + }, + { + "key": "remote_leader_crn" } ] } diff --git a/modules/fscloud/README.md b/modules/fscloud/README.md index 7420a5a1..2a2c2b76 100644 --- a/modules/fscloud/README.md +++ b/modules/fscloud/README.md @@ -46,6 +46,7 @@ No resources. | [name](#input\_name) | The name to give the Postgresql instance. | `string` | n/a | yes | | [pg\_version](#input\_pg\_version) | Version of the PostgreSQL instance. If no value is passed, the current preferred version of IBM Cloud Databases is used. | `string` | `null` | no | | [region](#input\_region) | The region where you want to deploy your instance. Must be the same region as the Hyper Protect Crypto Services instance. | `string` | `"us-south"` | no | +| [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 | | [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where the PostgreSQL instance will be created. | `string` | n/a | yes | | [resource\_tags](#input\_resource\_tags) | Optional list of tags to be added to the PostgreSQL instance. | `list(string)` | `[]` | no | | [service\_credential\_names](#input\_service\_credential\_names) | Map of name, role for service credentials that you want to create for the database | `map(string)` | `{}` | no | diff --git a/modules/fscloud/main.tf b/modules/fscloud/main.tf index 317b464c..2b33446c 100644 --- a/modules/fscloud/main.tf +++ b/modules/fscloud/main.tf @@ -3,6 +3,7 @@ module "postgresql_db" { resource_group_id = var.resource_group_id name = var.name region = var.region + remote_leader_crn = var.remote_leader_crn skip_iam_authorization_policy = var.skip_iam_authorization_policy service_endpoints = "private" pg_version = var.pg_version diff --git a/modules/fscloud/variables.tf b/modules/fscloud/variables.tf index 8d00d21c..c2f040c3 100644 --- a/modules/fscloud/variables.tf +++ b/modules/fscloud/variables.tf @@ -229,3 +229,9 @@ variable "backup_crn" { description = "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." default = null } + +variable "remote_leader_crn" { + type = string + description = "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" + default = null +} diff --git a/solutions/standard/main.tf b/solutions/standard/main.tf index ec5ad674..d823f798 100644 --- a/solutions/standard/main.tf +++ b/solutions/standard/main.tf @@ -248,6 +248,7 @@ module "postgresql_db" { resource_group_id = module.resource_group.resource_group_id name = var.prefix != null ? "${var.prefix}-${var.name}" : var.name region = var.region + remote_leader_crn = var.remote_leader_crn skip_iam_authorization_policy = var.skip_pg_kms_auth_policy pg_version = var.pg_version use_ibm_owned_encryption_key = var.use_ibm_owned_encryption_key diff --git a/solutions/standard/variables.tf b/solutions/standard/variables.tf index d29abf42..773bdc47 100644 --- a/solutions/standard/variables.tf +++ b/solutions/standard/variables.tf @@ -60,6 +60,12 @@ variable "backup_crn" { default = null } +variable "remote_leader_crn" { + type = string + description = "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. [Learn more](https://cloud.ibm.com/docs/databases-for-postgresql?topic=databases-for-postgresql-read-only-replicas)." + default = null +} + ############################################################################## # ICD hosting model properties ##############################################################################