diff --git a/main.tf b/main.tf index 3ac6cbe..2e19eba 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,7 @@ +locals { + name = var.name_postfix == null ? var.topic_name : format("%s-%s", var.topic_name, var.name_postfix) +} + resource "huaweicloud_smn_topic" "topic" { name = var.topic_name } diff --git a/variables.tf b/variables.tf index 9b40845..795f7cd 100644 --- a/variables.tf +++ b/variables.tf @@ -3,6 +3,13 @@ variable "topic_name" { type = string } + +variable "name_postfix" { + description = "Name Postfix" + type = string + default = null +} + variable "emails" { description = "Specifies the subscriptions emails" type = list(string)