Skip to content

Commit

Permalink
Add support to SNS Topic for SMS
Browse files Browse the repository at this point in the history
  • Loading branch information
lgallard committed Oct 25, 2021
1 parent cfd4463 commit c842f7a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions root/us-east-1/notifications/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ data "terraform_remote_state" "keys" {
data "vault_generic_secret" "slack_hook_url_monitoring" {
path = "secrets/${var.project}/${var.environment}/notifications"
}

data "vault_generic_secret" "notifications" {
path = "secrets/${var.project}/${var.environment}/notifications"
}
22 changes: 22 additions & 0 deletions root/us-east-1/notifications/sms_tools_monitoring.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module "sns" {
source = "github.com/binbashar/terraform-aws-sns-topic.git?ref=0.19.2"

name = var.sns_topic_name_sms

subscribers = {
phone1 = {
protocol = "sms"
endpoint = data.vault_generic_secret.notifications.data["phone1"]
}
#phone2 = {
# protocol = "sms"
# endpoint = data.vault_generic_secret.notifications.data["phone2"]
#}
#phone3 = {
# protocol = "sms"
# endpoint = data.vault_generic_secret.notifications.data["phone3"]
#}
}

sqs_dlq_enabled = false
}
5 changes: 5 additions & 0 deletions root/us-east-1/notifications/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ variable "sns_topic_name_monitoring_sec" {
default = "sns-topic-slack-notify-monitoring-sec"
}

variable "sns_topic_name_sms" {
description = ""
default = "sns-topic-sms"
}

#=============================#
# Hashicorp Vault Vars #
#=============================#
Expand Down

0 comments on commit c842f7a

Please sign in to comment.