Skip to content

Commit

Permalink
fix: added fix for validation bug<br>- added default values in the DA…
Browse files Browse the repository at this point in the history
… for `admin_pass_sm_secret_group` ("elasticsearch-secrets") and `admin_pass_sm_secret_name` ("elasticsearch-admin-password") (#298)
  • Loading branch information
akocbek authored Sep 25, 2024
1 parent 71e66a2 commit e220b34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions solutions/standard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ locals {

admin_pass = var.admin_pass == null ? random_password.admin_password[0].result : var.admin_pass
admin_pass_secret = [{
secret_group_name = var.prefix != null ? "${var.prefix}-${var.admin_pass_sm_secret_group}" : var.admin_pass_sm_secret_group
secret_group_name = var.prefix != null && var.admin_pass_sm_secret_group != null ? "${var.prefix}-${var.admin_pass_sm_secret_group}" : var.admin_pass_sm_secret_group
existing_secret_group = var.use_existing_admin_pass_sm_secret_group
secrets = [{
secret_name = var.prefix != null ? "${var.prefix}-${var.admin_pass_sm_secret_name}" : var.admin_pass_sm_secret_name
secret_name = var.prefix != null && var.admin_pass_sm_secret_name != null ? "${var.prefix}-${var.admin_pass_sm_secret_name}" : var.admin_pass_sm_secret_name
secret_type = "arbitrary"
secret_payload_password = local.admin_pass
}
Expand Down
4 changes: 2 additions & 2 deletions solutions/standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ variable "skip_es_sm_auth_policy" {
variable "admin_pass_sm_secret_group" {
type = string
description = "The name of a new or existing secrets manager secret group for admin password. To use existing secret group, `use_existing_admin_pass_sm_secret_group` must be set to `true`. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format."
default = null
default = "elasticsearch-secrets"
}

variable "use_existing_admin_pass_sm_secret_group" {
Expand All @@ -313,5 +313,5 @@ variable "use_existing_admin_pass_sm_secret_group" {
variable "admin_pass_sm_secret_name" {
type = string
description = "The name of a new elasticsearch administrator secret. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format."
default = null
default = "elasticsearch-admin-password"
}

0 comments on commit e220b34

Please sign in to comment.