Skip to content

Commit 3884b76

Browse files
authored
fix: Add workaround to ignore groups config when provisioning instance using backup CRN (#273)
1 parent 6a3e782 commit 3884b76

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ resource "ibm_database" "rabbitmq_database" {
7070
}
7171
}
7272

73+
# Workaround for https://github.ibm.com/GoldenEye/issues/issues/11359
74+
# means that no `group` block is added when restoring from backup
75+
7376
## This for_each block is NOT a loop to attach to multiple group blocks.
7477
## This is used to conditionally add one, OR, the other group block depending on var.local.host_flavor_set
7578
## This block is for if host_flavor IS set to specific pre-defined host sizes and not set to "multitenant"
7679
dynamic "group" {
77-
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" ? [1] : []
80+
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" && var.backup_crn == null ? [1] : []
7881
content {
7982
group_id = "member" # Only member type is allowed for IBM Cloud Databases
8083
host_flavor {
@@ -91,7 +94,7 @@ resource "ibm_database" "rabbitmq_database" {
9194

9295
## This block is for if host_flavor IS set to "multitenant"
9396
dynamic "group" {
94-
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" ? [1] : []
97+
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" && var.backup_crn == null ? [1] : []
9598
content {
9699
group_id = "member" # Only member type is allowed for IBM Cloud Databases
97100
host_flavor {
@@ -114,7 +117,7 @@ resource "ibm_database" "rabbitmq_database" {
114117

115118
## This block is for if host_flavor IS NOT set
116119
dynamic "group" {
117-
for_each = local.host_flavor_set ? [] : [1]
120+
for_each = !local.host_flavor_set && var.backup_crn == null ? [1] : []
118121
content {
119122
group_id = "member" # Only member type is allowed for IBM Cloud Databases
120123
memory {

0 commit comments

Comments
 (0)