Skip to content

Commit 5cb1dbd

Browse files
authored
fix: Add workaround to ignore groups config when provisioning instance using backup CRN (#443)
1 parent 5cf1565 commit 5cb1dbd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ resource "ibm_database" "mongodb" {
8080
## This is used to conditionally add one, OR, the other group block depending on var.local.host_flavor_set
8181
## This block is for if host_flavor IS set to specific pre-defined host sizes and not set to "multitenant"
8282
dynamic "group" {
83-
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" ? [1] : []
83+
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" && var.backup_crn == null ? [1] : []
8484
content {
8585
group_id = "member" # Only member type is allowed for IBM Cloud Databases
8686
host_flavor {
@@ -97,7 +97,7 @@ resource "ibm_database" "mongodb" {
9797

9898
## This block is for if host_flavor IS set to "multitenant"
9999
dynamic "group" {
100-
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" ? [1] : []
100+
for_each = local.host_flavor_set && var.member_host_flavor == "multitenant" && var.backup_crn == null ? [1] : []
101101
content {
102102
group_id = "member" # Only member type is allowed for IBM Cloud Databases
103103
host_flavor {
@@ -120,7 +120,7 @@ resource "ibm_database" "mongodb" {
120120

121121
## This block is for if host_flavor IS NOT set
122122
dynamic "group" {
123-
for_each = local.host_flavor_set ? [] : [1]
123+
for_each = !local.host_flavor_set && var.backup_crn == null ? [1] : []
124124
content {
125125
group_id = "member" # Only member type is allowed for IBM Cloud Databases
126126
memory {
@@ -178,6 +178,8 @@ resource "ibm_database" "mongodb" {
178178

179179
timeouts {
180180
create = "120m" # Extending provisioning time to 120 minutes
181+
update = "120m"
182+
delete = "15m"
181183
}
182184
}
183185

0 commit comments

Comments
 (0)