Skip to content

Commit bf157c6

Browse files
feat: expose remote_leader_crn input in fscloud module and DA to allow provisioning of read only replicas (#572)
1 parent c8ddb0c commit bf157c6

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

ibm_catalog.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@
287287
},
288288
{
289289
"key": "backup_crn"
290+
},
291+
{
292+
"key": "remote_leader_crn"
290293
}
291294
]
292295
}

modules/fscloud/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ No resources.
4646
| <a name="input_name"></a> [name](#input\_name) | The name to give the Postgresql instance. | `string` | n/a | yes |
4747
| <a name="input_pg_version"></a> [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 |
4848
| <a name="input_region"></a> [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 |
49+
| <a name="input_remote_leader_crn"></a> [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 |
4950
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where the PostgreSQL instance will be created. | `string` | n/a | yes |
5051
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | Optional list of tags to be added to the PostgreSQL instance. | `list(string)` | `[]` | no |
5152
| <a name="input_service_credential_names"></a> [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 |

modules/fscloud/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module "postgresql_db" {
33
resource_group_id = var.resource_group_id
44
name = var.name
55
region = var.region
6+
remote_leader_crn = var.remote_leader_crn
67
skip_iam_authorization_policy = var.skip_iam_authorization_policy
78
service_endpoints = "private"
89
pg_version = var.pg_version

modules/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,9 @@ variable "backup_crn" {
229229
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."
230230
default = null
231231
}
232+
233+
variable "remote_leader_crn" {
234+
type = string
235+
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"
236+
default = null
237+
}

solutions/standard/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ module "postgresql_db" {
248248
resource_group_id = module.resource_group.resource_group_id
249249
name = var.prefix != null ? "${var.prefix}-${var.name}" : var.name
250250
region = var.region
251+
remote_leader_crn = var.remote_leader_crn
251252
skip_iam_authorization_policy = var.skip_pg_kms_auth_policy
252253
pg_version = var.pg_version
253254
use_ibm_owned_encryption_key = var.use_ibm_owned_encryption_key

solutions/standard/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ variable "backup_crn" {
6060
default = null
6161
}
6262

63+
variable "remote_leader_crn" {
64+
type = string
65+
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)."
66+
default = null
67+
}
68+
6369
##############################################################################
6470
# ICD hosting model properties
6571
##############################################################################

0 commit comments

Comments
 (0)