provider "aws" {
  region = "us-east-1"
}

# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "orcd-terraform-state"
    key     = "qa/rbencoder/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "rbencoder_httpd_process_monitor" {
  source = "git@github.com:theorchard/terraform-datadog.git//modules/process?ref=3.0.17"

  environment                       = var.environment
  service_name                      = "vector_rbencoder"
  tag_based_alert_enabled           = true
  process_name                      = "httpd.exe"
  process_query_tags                = "service_name:vector_rbencoder, environment:${var.environment}"
  threshold_warning                 = 2
  threshold_critical                = 1
  monitor_measurement_interval      = "15m"
  notification_endpoints            = var.notification_endpoints
  escalation_notification_endpoints = var.notification_endpoints
}
