From acc7c7273b69544a564037fb5f60564449e64fc7 Mon Sep 17 00:00:00 2001 From: Darren Lee <167146344+darrenl33@users.noreply.github.com> Date: Thu, 7 Nov 2024 08:32:09 -0800 Subject: [PATCH] Allow removal of cluster name from aurora ssm parameter (https://github.com/cloudposse/terraform-aws-components/pull/1162) Co-authored-by: Benjamin Smith Co-authored-by: Igor Rodionov --- src/ssm.tf | 2 +- src/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ssm.tf b/src/ssm.tf index 9b74979..9e62a50 100644 --- a/src/ssm.tf +++ b/src/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/src/variables.tf b/src/variables.tf index ea71e52..1bc2277 100644 --- a/src/variables.tf +++ b/src/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" +}