Skip to content

Commit

Permalink
Allow overriding bastion storage pool
Browse files Browse the repository at this point in the history
Signed-off-by: Yussuf Shaikh <yussuf.shaikh1@ibm.com>
  • Loading branch information
yussufsh committed Feb 21, 2024
1 parent 82c0202 commit cf27712
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions modules/1_prepare/prepare.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ locals {
length(local.project_bastion_image) == 0 ? ibm_pi_image.bastion[0].image_id : local.project_bastion_image[0].id
)
)
# If invalid then use hardcoded value; else if project image pool is not empty use catalog image pool; else if project image pool is empty use catalog image pool; else use project image pool
# If bastion.storage_pool is provided use it directly (Required because of bug in catalog image containing invalid pool)
# If invalid then use hardcoded value
# If catalog image is used then use catalog image pool
# If project image pool is not empty use project image pool;
# If project image pool is empty use catalog image pool;
bastion_storage_pool = (
local.invalid_bastion_image ? "Tier3-Flash-1" : (
length(local.project_bastion_image) == 0 ? local.catalog_bastion_image[0].storage_pool : (
local.project_bastion_image[0].storage_pool == "" ? local.catalog_bastion_image[0].storage_pool : local.project_bastion_image[0].storage_pool
var.bastion["storage_pool"] != "" ? var.bastion["storage_pool"] : (
local.invalid_bastion_image ? "Tier3-Flash-1" : (
length(local.project_bastion_image) == 0 ? local.catalog_bastion_image[0].storage_pool : (
local.project_bastion_image[0].storage_pool == "" ? local.catalog_bastion_image[0].storage_pool : local.project_bastion_image[0].storage_pool
)
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ variable "ibmcloud_zone" {
################################################################

variable "bastion" {
type = object({ count = number, memory = string, processors = string })
type = object({ count = number, memory = string, processors = string, storage_pool = string })
default = {
count = 1
memory = "16"
Expand Down

0 comments on commit cf27712

Please sign in to comment.