Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@
"key": "resource_group_name"
},
{
"key": "prefix"
"key": "prefix",
"required": true,
"description":"Prefix to add to all resources created by this solution. To not use any prefix value, you can enter the string `__NULL__`."
},
{
"key": "name"
Expand Down
8 changes: 4 additions & 4 deletions solutions/standard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module "resource_group" {
source = "terraform-ibm-modules/resource-group/ibm"
version = "1.1.6"
resource_group_name = var.use_existing_resource_group == false ? (var.prefix != null ? "${var.prefix}-${var.resource_group_name}" : var.resource_group_name) : null
resource_group_name = var.use_existing_resource_group == false ? ((var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.resource_group_name}" : var.resource_group_name) : null
existing_resource_group_name = var.use_existing_resource_group == true ? var.resource_group_name : null
}

Expand All @@ -29,8 +29,8 @@ locals {

locals {
create_new_kms_key = !var.use_ibm_owned_encryption_key && var.existing_kms_key_crn == null ? true : false # no need to create any KMS resources if passing an existing key, or using IBM owned keys
postgres_key_name = var.prefix != null ? "${var.prefix}-${var.key_name}" : var.key_name
postgres_key_ring_name = var.prefix != null ? "${var.prefix}-${var.key_ring_name}" : var.key_ring_name
postgres_key_name = (var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.key_name}" : var.key_name
postgres_key_ring_name = (var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.key_ring_name}" : var.key_ring_name
}

module "kms" {
Expand Down Expand Up @@ -246,7 +246,7 @@ module "postgresql_db" {
source = "../../modules/fscloud"
depends_on = [time_sleep.wait_for_authorization_policy, time_sleep.wait_for_backup_kms_authorization_policy]
resource_group_id = module.resource_group.resource_group_id
name = var.prefix != null ? "${var.prefix}-${var.name}" : var.name
name = (var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.name}" : var.name
region = var.region
remote_leader_crn = var.remote_leader_crn
skip_iam_authorization_policy = var.skip_pg_kms_auth_policy
Expand Down
4 changes: 2 additions & 2 deletions solutions/standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ variable "resource_group_name" {

variable "prefix" {
type = string
description = "Prefix to add to all resources created by this solution."
default = null
description = "Prefix to add to all resources created by this solution. To not use any prefix value, you can set this value to `null` or an empty string."
default = "postgresql"
}

variable "name" {
Expand Down