diff --git a/modules/aurora-postgres/ssm.tf b/modules/aurora-postgres/ssm.tf index 9b74979dd..9e62a508f 100644 --- a/modules/aurora-postgres/ssm.tf +++ b/modules/aurora-postgres/ssm.tf @@ -1,5 +1,5 @@ locals { - ssm_path_prefix = format("/%s/%s", var.ssm_path_prefix, module.cluster.id) + ssm_path_prefix = length(var.ssm_cluster_name_override) > 0 ? format("/%s/%s", var.ssm_path_prefix, var.ssm_cluster_name_override) : format("/%s/%s", var.ssm_path_prefix, module.cluster.id) admin_user_key = format("%s/%s/%s", local.ssm_path_prefix, "admin", "user") admin_password_key = format("%s/%s/%s", local.ssm_path_prefix, "admin", "password") diff --git a/modules/aurora-postgres/variables.tf b/modules/aurora-postgres/variables.tf index ea71e52f0..1bc227790 100644 --- a/modules/aurora-postgres/variables.tf +++ b/modules/aurora-postgres/variables.tf @@ -352,3 +352,9 @@ variable "backup_window" { default = "07:00-09:00" description = "Daily time range during which the backups happen, UTC" } + +variable "ssm_cluster_name_override" { + type = string + default = "" + description = "Set a cluster name into the ssm path prefix" +}