Skip to content

Commit

Permalink
fix default behaviour when not aws_sns_topic does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
renato-dnx committed Aug 20, 2024
1 parent 46468bb commit 16ec64a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ variable "sns_topic_name" {
default = "CISAlarmV2"
}

variable "chatbot_sns_topic" {
variable "alarm_notification_sns_topic" {
description = "The arn of the SNS Topic which will be notified when any alarm is performed."
type = string
default = ""
Expand Down
2 changes: 1 addition & 1 deletion alarms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ resource "aws_cloudformation_stack" "cloudtrail_alarm" {

parameters = {
CloudTrailLogGroupName = var.cloudtrail_log_group_name
AlarmNotificationTopic = var.chatbot_sns_topic
AlarmNotificationTopic = try(aws_sns_topic.alarms[0].arn, var.alarm_notification_sns_topic)
}
}

0 comments on commit 16ec64a

Please sign in to comment.