# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "gdb-delphi-prod-tfstate"
    key     = "prod/datadog/slack-integration/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
    profile = "gdb-delphi-prod"
  }
}

# Datadog provider
provider "datadog" {}

resource "datadog_integration_slack_channel" "alerts_test" {
  account_name = "The_Orchard"
  channel_name = "#alerts-test"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "slz_alerts" {
  account_name = "The_Orchard"
  channel_name = "#slz-alerts"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}


resource "datadog_integration_slack_channel" "apps_etl_alerts" {
  account_name = "The_Orchard"
  channel_name = "#apps-etl-alerts"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "delphi_api_alerts" {
  account_name = "The_Orchard"
  channel_name = "#delphi-api-alerts"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "delphi_outage_alerts" {
  account_name = "The_Orchard"
  channel_name = "#delphi-outage-alerts"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "delphi_dapd_alerts" {
  account_name = "The_Orchard"
  channel_name = "#delphi-dapd-alerts"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "delphi_dtf_alerts_prod" {
  account_name = "The_Orchard"
  channel_name = "#delphi-dtf-alerts-prod"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}

resource "datadog_integration_slack_channel" "delphi_ns_alerts_prod" {
  account_name = "The_Orchard"
  channel_name = "#delphi-ns-alerts-prod"

  display {
    message  = true
    notified = true
    snapshot = true
    tags     = true
  }
}
