Skip to content

Commit f454ec2

Browse files
authored
fix: improved user experience for the auto_scaling input in the deployable architecture (#525)
1 parent feb5513 commit f454ec2

File tree

4 files changed

+58
-6
lines changed

4 files changed

+58
-6
lines changed

ibm_catalog.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,12 @@
276276
"key": "member_host_flavor"
277277
},
278278
{
279-
"key": "auto_scaling"
279+
"key": "auto_scaling",
280+
"custom_config": {
281+
"type": "code_editor",
282+
"grouping": "deployment",
283+
"original_grouping": "deployment"
284+
}
280285
},
281286
{
282287
"key": "service_endpoints",
@@ -710,7 +715,12 @@
710715
"key": "member_host_flavor"
711716
},
712717
{
713-
"key": "auto_scaling"
718+
"key": "auto_scaling",
719+
"custom_config": {
720+
"type": "code_editor",
721+
"grouping": "deployment",
722+
"original_grouping": "deployment"
723+
}
714724
},
715725
{
716726
"key": "deletion_protection"

solutions/fully-configurable/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ locals {
447447
code_engine_project_name = local.code_engine_project_id != null ? null : (var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.kibana_code_engine_new_project_name}" : var.kibana_code_engine_new_project_name
448448
code_engine_app_name = (var.prefix != null && var.prefix != "") ? "${var.prefix}-${var.kibana_code_engine_new_app_name}" : var.kibana_code_engine_new_app_name
449449
kibana_version = var.enable_kibana_dashboard ? jsondecode(data.http.es_metadata[0].response_body).version.number : null
450-
kibana_system_password = var.enable_kibana_dashboard ? random_password.kibana_system_password[0].result : null
451-
kibana_app_login_password = var.enable_kibana_dashboard ? random_password.kibana_app_login_password[0].result : null
450+
kibana_system_password = var.enable_kibana_dashboard ? startswith(random_password.kibana_system_password[0].result, "-") ? "J${substr(random_password.kibana_system_password[0].result, 1, -1)}" : startswith(random_password.kibana_system_password[0].result, "_") ? "K${substr(random_password.kibana_system_password[0].result, 1, -1)}" : random_password.kibana_system_password[0].result : null
451+
kibana_app_login_password = var.enable_kibana_dashboard ? startswith(random_password.kibana_app_login_password[0].result, "-") ? "J${substr(random_password.kibana_app_login_password[0].result, 1, -1)}" : startswith(random_password.kibana_app_login_password[0].result, "_") ? "K${substr(random_password.kibana_app_login_password[0].result, 1, -1)}" : random_password.kibana_app_login_password[0].result : null
452452
}
453453

454454
data "http" "es_metadata" {

solutions/fully-configurable/variables.tf

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,28 @@ variable "auto_scaling" {
338338
})
339339
})
340340
description = "Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/blob/main/solutions/fully-configurable/DA-types.md#autoscaling)"
341-
default = null
341+
default = {
342+
disk = {
343+
capacity_enabled = false
344+
free_space_less_than_percent = 10
345+
io_above_percent = 90
346+
io_enabled = false
347+
io_over_period = "15m"
348+
rate_increase_percent = 10
349+
rate_limit_mb_per_member = 3670016
350+
rate_period_seconds = 900
351+
rate_units = "mb"
352+
}
353+
memory = {
354+
io_above_percent = 90
355+
io_enabled = false
356+
io_over_period = "15m"
357+
rate_increase_percent = 10
358+
rate_limit_mb_per_member = 114688
359+
rate_period_seconds = 900
360+
rate_units = "mb"
361+
}
362+
}
342363
}
343364

344365
#############################################################################

solutions/security-enforced/variables.tf

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,28 @@ variable "auto_scaling" {
275275
})
276276
})
277277
description = "Optional rules to allow the database to increase resources in response to usage. Only a single autoscaling block is allowed. Make sure you understand the effects of autoscaling, especially for production environments. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/tree/main/solutions/fully-configurable/DA-types.md#autoscaling)"
278-
default = null
278+
default = {
279+
disk = {
280+
capacity_enabled = false
281+
free_space_less_than_percent = 10
282+
io_above_percent = 90
283+
io_enabled = false
284+
io_over_period = "15m"
285+
rate_increase_percent = 10
286+
rate_limit_mb_per_member = 3670016
287+
rate_period_seconds = 900
288+
rate_units = "mb"
289+
}
290+
memory = {
291+
io_above_percent = 90
292+
io_enabled = false
293+
io_over_period = "15m"
294+
rate_increase_percent = 10
295+
rate_limit_mb_per_member = 114688
296+
rate_period_seconds = 900
297+
rate_units = "mb"
298+
}
299+
}
279300
}
280301

281302
#############################################################################

0 commit comments

Comments
 (0)