Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ resource "ibm_database" "mongodb" {
## This is used to conditionally add one, OR, the other group block depending on var.local.host_flavor_set
## This block is for if host_flavor IS set to specific pre-defined host sizes and not set to "multitenant"
dynamic "group" {
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" ? [1] : []
for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" && var.backup_crn == null ? [1] : []
content {
group_id = "member" # Only member type is allowed for IBM Cloud Databases
host_flavor {
Expand All @@ -97,7 +97,7 @@ resource "ibm_database" "mongodb" {

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

## This block is for if host_flavor IS NOT set
dynamic "group" {
for_each = local.host_flavor_set ? [] : [1]
for_each = local.host_flavor_set && var.backup_crn == null ? [] : [1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That logic was wrong and later improved in postgresql to:

for_each = local.host_flavor_set == false && !local.recovery_mode ? [1] : []

Without pitr I think it needs to be

for_each = local.host_flavor_set == false && !var.backup_crn ? [1] : []

content {
group_id = "member" # Only member type is allowed for IBM Cloud Databases
memory {
Expand Down Expand Up @@ -178,6 +178,8 @@ resource "ibm_database" "mongodb" {

timeouts {
create = "120m" # Extending provisioning time to 120 minutes
update = "120m"
delete = "15m"
}
}

Expand Down