Skip to content

Instantly share code, notes, and snippets.

@100daysofdevops
Created February 28, 2019 17:53
Show Gist options
  • Select an option

  • Save 100daysofdevops/f486573541363627146b7e8fe55ddf0b to your computer and use it in GitHub Desktop.

Select an option

Save 100daysofdevops/f486573541363627146b7e8fe55ddf0b to your computer and use it in GitHub Desktop.
resource "aws_sns_topic" "alarm" {
name = "alarms-topic"
delivery_policy = <<EOF
{
"http": {
"defaultHealthyRetryPolicy": {
"minDelayTarget": 20,
"maxDelayTarget": 20,
"numRetries": 3,
"numMaxDelayRetries": 0,
"numNoDelayRetries": 0,
"numMinDelayRetries": 0,
"backoffFunction": "linear"
},
"disableSubscriptionOverrides": false,
"defaultThrottlePolicy": {
"maxReceivesPerSecond": 1
}
}
}
EOF
provisioner "local-exec" {
command = "aws sns subscribe --topic-arn ${self.arn} --protocol email --notification-endpoint ${var.alarms_email}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment