Skip to content

Commit a97fafb

Browse files
feat: added support to the fscloud submodule and the DA to provision a read only replica using input remote_leader_crn(#200)
Co-authored-by: Conall Ó Cofaigh <[email protected]>
1 parent 5656ae1 commit a97fafb

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
@@ -45,6 +45,7 @@ No resources.
4545
| <a name="input_members"></a> [members](#input\_members) | Allocated number of members. Members can be scaled up but not down. | `number` | `3` | no |
4646
| <a name="input_mysql_version"></a> [mysql\_version](#input\_mysql\_version) | Version of the MySQL instance. If no value is passed, the current preferred version of IBM Cloud Databases is used. | `string` | `null` | no |
4747
| <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 |
48+
| <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-mysql?topic=databases-for-mysql-read-replicas | `string` | `null` | no |
4849
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where the MySQL instance will be created. | `string` | n/a | yes |
4950
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | Optional list of tags to be added to the MySQL instance. | `list(string)` | `[]` | no |
5051
| <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
@@ -24,4 +24,5 @@ module "mysql_db" {
2424
users = var.users
2525
service_credential_names = var.service_credential_names
2626
auto_scaling = var.auto_scaling
27+
remote_leader_crn = var.remote_leader_crn
2728
}

modules/fscloud/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "region" {
2424
default = "us-south"
2525
}
2626

27+
variable "remote_leader_crn" {
28+
type = string
29+
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-mysql?topic=databases-for-mysql-read-replicas"
30+
default = null
31+
}
32+
2733
##############################################################################
2834
# ICD hosting model properties
2935
##############################################################################

solutions/standard/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ module "mysql" {
266266
auto_scaling = var.auto_scaling
267267
service_credential_names = var.service_credential_names
268268
backup_crn = var.backup_crn
269+
remote_leader_crn = var.remote_leader_crn
269270
}
270271

271272
locals {

solutions/standard/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ variable "region" {
3636
default = "us-south"
3737
}
3838

39+
variable "remote_leader_crn" {
40+
type = string
41+
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-mysql?topic=databases-for-mysql-read-replicas)"
42+
default = null
43+
}
44+
3945
variable "mysql_version" {
4046
description = "The version of the Databases for MySQL instance. If no value is specified, the current preferred version of Databases for MySQL is used."
4147
type = string

0 commit comments

Comments
 (0)