From 360cb51cfae53666616480c9af1dadbac6c0ec89 Mon Sep 17 00:00:00 2001 From: Clarissa Borges Date: Thu, 27 Jul 2023 17:36:10 -0300 Subject: [PATCH] Allow kms to receive a custom alias name When setting up the telemetry module for multiple environments, a new kms_alias is created for SNS, but it's not possible to create multiple aliases with the same name. This allows to have a custom name. --- aws/telemetry/main.tf | 2 ++ aws/telemetry/modules/sns-topics/variables.tf | 5 +++++ aws/telemetry/variables.tf | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/aws/telemetry/main.tf b/aws/telemetry/main.tf index 236b964e..f9db7b77 100644 --- a/aws/telemetry/main.tf +++ b/aws/telemetry/main.tf @@ -11,6 +11,8 @@ module "sns_topics" { "${source}-${severity}" ] ]) + + kms_alias_name = var.kms_alias_name } module "prometheus_workspace" { diff --git a/aws/telemetry/modules/sns-topics/variables.tf b/aws/telemetry/modules/sns-topics/variables.tf index 83c7c6b6..8dbaf2b5 100644 --- a/aws/telemetry/modules/sns-topics/variables.tf +++ b/aws/telemetry/modules/sns-topics/variables.tf @@ -15,6 +15,11 @@ variable "sns_topic_names" { type = list(string) } +variable "kms_alias_name" { + description = "KMS alias name for SNS topics" + type = string +} + variable "tags" { description = "Tags to be applied to created resources" type = map(string) diff --git a/aws/telemetry/variables.tf b/aws/telemetry/variables.tf index 20513abb..df0e9e7e 100644 --- a/aws/telemetry/variables.tf +++ b/aws/telemetry/variables.tf @@ -68,3 +68,9 @@ variable "tags" { type = map(string) default = {} } + +variable "kms_alias_name" { + description = "KMS alias name for SNS topics" + type = string + default = "alias/sns-alarm-topics" +}