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

# Datadog provider
provider "datadog" {}

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

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

resource "datadog_integration_slack_channel" "delphi_lambda_failures_non_prod" {
  account_name = "The_Orchard"
  channel_name = "#delphi-lambda-failures-non-prod"

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

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

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

resource "datadog_integration_slack_channel" "delphi_dtf_alerts_nonprod" {
  account_name = "The_Orchard"
  channel_name = "#delphi-dtf-alerts-nonprod"

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

resource "datadog_integration_slack_channel" "delphi_ns_alerts_nonprod" {
  account_name = "The_Orchard"
  channel_name = "#delphi-ns-alerts-nonprod"

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