handlers.tf 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. locals {
  2. victorops_team = var.environment == "test" ? "test" : "engineering"
  3. }
  4. resource "sensu_handler" "handler_keepalive" {
  5. # No victorops in test at all pl0x
  6. count = var.environment == "test" ? 0 : 1
  7. name = "keepalive"
  8. type = "set"
  9. namespace = "default"
  10. handlers = [ "victorops", ]
  11. }
  12. resource "sensu_handler" "handler_victorops" {
  13. name = "victorops"
  14. type = "pipe"
  15. namespace = "default"
  16. handlers = [ "victorops", ]
  17. filters = [ "is_incident", "not_silenced", "handler-delay", ]
  18. runtime_assets = [ "sensu-plugins-victorops", "sensu-ruby-runtime", ]
  19. command = "handler-victorops.rb --map_go_event_into_ruby -a https://alert.victorops.com/integrations/generic/20131114/alert/864a1b38-4243-4137-8baa-b587ba5f300b/ -r ${local.victorops_team}"
  20. }
  21. resource "sensu_handler" "handler_logfile" {
  22. name = "logfile"
  23. type = "pipe"
  24. namespace = "default"
  25. handlers = [ ]
  26. filters = [ ]
  27. runtime_assets = [ "sensu-ruby-runtime", ]
  28. command = "/usr/local/bin/stdin_to_log.py"
  29. }
  30. resource "sensu_handler" "handler_email" {
  31. name = "email-xdr-eng"
  32. type = "pipe"
  33. namespace = "default"
  34. handlers = [ ]
  35. filters = [ "is_incident", "not_silenced" ]
  36. runtime_assets = [ "sensu/sensu-email-handler", ]
  37. command = "sensu-email-handler -f sensu@${local.smtp_secrets["mail_from_domain"]} -t duane.e.waddle@accenturefederal.com -T /etc/sensu/email-template -s ${local.smtp_secrets["mail_host"]} -u ${local.smtp_secrets["mail_user"]} -p '${local.smtp_secrets["mail_password"]}'"
  38. timeout = 10
  39. }