Skip to content

Instantly share code, notes, and snippets.

@KensoDev
Created April 14, 2017 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KensoDev/00daa176caf0816335bf801271753c5f to your computer and use it in GitHub Desktop.
Save KensoDev/00daa176caf0816335bf801271753c5f to your computer and use it in GitHub Desktop.
Cluster notification terraform
/*
Read more about event patterns here:
http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html
*/
data "template_file" "event_pattern" {
template = "${file("${path.module}/files/deploy-notification.json.tpl")}"
vars = {
cluster_arn = "${aws_ecs_cluster.ecs.id}"
}
}
resource "aws_cloudwatch_event_rule" "failed-deploy" {
name = "failed-deploy-${var.name}-${var.environment}"
description = "Deploy failure notificatioon ${var.name}-${var.environment}"
event_pattern = "${data.template_file.event_pattern.rendered}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment