locals { victorops_team = var.environment == "test" ? "test" : "engineering" } resource "sensu_mutator" "mutator_xdr" { name = "xdr_mutator" command = "/usr/local/bin/xdr_mutator.py" } resource "sensu_handler" "handler_keepalive" { # No victorops in test at all pl0x count = var.environment == "test" ? 0 : 1 name = "keepalive" type = "set" namespace = "default" handlers = ["victorops", ] } resource "sensu_handler" "handler_victorops" { name = "victorops" type = "pipe" namespace = "default" handlers = ["victorops", ] mutator = sensu_mutator.mutator_xdr.id filters = ["is_incident", "not_silenced", "handler-delay", ] runtime_assets = ["sensu-plugins-victorops", "sensu-ruby-runtime", ] 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}" } resource "sensu_handler" "handler_logfile" { name = "logfile" type = "pipe" namespace = "default" handlers = [] filters = [] runtime_assets = ["sensu-ruby-runtime", ] command = "/usr/local/bin/stdin_to_log.py" } resource "sensu_handler" "handler_email" { name = "email-xdr-eng" type = "pipe" namespace = "default" handlers = [] filters = ["is_incident", "not_silenced"] runtime_assets = ["sensu/sensu-email-handler", ] 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"]}'" timeout = 10 }