This repository was archived by the owner on Jun 17, 2025. It is now read-only.
generated from terraform-ibm-modules/terraform-ibm-module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,9 @@ locals { | |
| # Determine if host_flavor is used | ||
| host_flavor_set = var.member_host_flavor != null ? true : false | ||
|
|
||
| # Determine if restore, from backup or point in time recovery | ||
| recovery_mode = var.backup_crn != null || var.pitr_id != null | ||
|
|
||
| # Determine what KMS service is being used for database encryption | ||
| kms_service = var.kms_key_crn != null ? ( | ||
| can(regex(".*kms.*", var.kms_key_crn)) ? "kms" : ( | ||
|
|
@@ -84,11 +87,15 @@ resource "ibm_database" "enterprise_db" { | |
| } | ||
| } | ||
|
|
||
| # Workaround for https://github.ibm.com/GoldenEye/issues/issues/11359 | ||
| # means that no `group` block is added when restoring from backup | ||
| # or point in time recovery | ||
|
|
||
| ## This for_each block is NOT a loop to attach to multiple group blocks. | ||
| ## 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 ? [1] : [] | ||
| for_each = local.host_flavor_set && var.member_host_flavor != "multitenant" && !local.recovery_mode ? [1] : [] | ||
| content { | ||
| group_id = "member" # Only member type is allowed for IBM Cloud Databases | ||
| host_flavor { | ||
|
|
@@ -112,15 +119,18 @@ resource "ibm_database" "enterprise_db" { | |
|
|
||
| ## 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.member_host_flavor == "multitenant" && !local.recovery_mode ? [1] : [] | ||
|
||
| content { | ||
| group_id = "member" # Only member type is allowed for IBM Cloud Databases | ||
| memory { | ||
| allocation_mb = var.member_memory_mb | ||
| host_flavor { | ||
| id = var.member_host_flavor | ||
|
||
| } | ||
| disk { | ||
| allocation_mb = var.member_disk_mb | ||
| } | ||
| memory { | ||
| allocation_mb = var.member_memory_mb | ||
| } | ||
| cpu { | ||
| allocation_count = var.member_cpu_count | ||
| } | ||
|
|
@@ -172,6 +182,8 @@ resource "ibm_database" "enterprise_db" { | |
|
|
||
| timeouts { | ||
| create = "120m" # Extending provisioning time to 120 minutes | ||
| update = "120m" | ||
| delete = "15m" | ||
| } | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no
plantype that supports multi tenant (for EDB, it is enterprise and isolated only). So the structure here is a bit different, remove&& var.member_host_flavor != "multitenant"