Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 46e4f6c

Browse files
jor2Jordan-Williams2
andauthored
fix: Add workaround to ignore groups config when provisioning instance using backup CRN (#257)
* feat: add workaround for groups * feat: add workaround for groups * fix: if condition --------- Co-authored-by: Jordan-Williams2 <[email protected]>
1 parent 1a93647 commit 46e4f6c

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
@@ -77,11 +77,14 @@ resource "ibm_database" "etcd_db" {
7777
}
7878
}
7979

80+
# Workaround for https://github.ibm.com/GoldenEye/issues/issues/11359
81+
# means that no `group` block is added when restoring from backup
82+
8083
## This for_each block is NOT a loop to attach to multiple group blocks.
8184
## This is used to conditionally add one, OR, the other group block depending on var.local.host_flavor_set
8285
## This block is for if host_flavor IS set to specific pre-defined host sizes and not set to "multitenant"
8386
dynamic "group" {
84-
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" ? [1] : []
87+
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" && var.backup_crn == null ? [1] : []
8588
content {
8689
group_id = "member" # Only member type is allowed for IBM Cloud Databases
8790
host_flavor {
@@ -98,7 +101,7 @@ resource "ibm_database" "etcd_db" {
98101

99102
## This block is for if host_flavor IS set to "multitenant"
100103
dynamic "group" {
101-
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" ? [1] : []
104+
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" && var.backup_crn == null ? [1] : []
102105
content {
103106
group_id = "member" # Only member type is allowed for IBM Cloud Databases
104107
host_flavor {
@@ -121,7 +124,7 @@ resource "ibm_database" "etcd_db" {
121124

122125
## This block is for if host_flavor IS NOT set
123126
dynamic "group" {
124-
for_each = local.host_flavor_set ? [] : [1]
127+
for_each = !local.host_flavor_set && var.backup_crn == null ? [1] : []
125128
content {
126129
group_id = "member" # Only member type is allowed for IBM Cloud Databases
127130
memory {

0 commit comments

Comments
 (0)