provider "aws" {
  region = var.region
}

terraform {
  backend "s3" {
    bucket  = "qa-songwhip-terraform-state"
    key     = "qa/songwhip-slack/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

# Decommissioned (AD-2916): the Slack app's AWS resources were removed so Atlantis
# destroys them on apply — the IAM user/policy/attachment, the songwhip-slack-staging
# DynamoDB table, and the Secrets Manager secrets.
#
# The Sentry project module is intentionally RETAINED. Its provider configuration lives
# inside the module, so removing it would orphan the sentry_project still in state and
# Terraform cannot destroy a resource whose provider config is gone ("Provider
# configuration not present"). The Sentry project is retired separately: delete it in the
# Sentry UI, then `terraform state rm` the orphan and delete this directory in a follow-up.
#
# WARNING: applying this destroys the songwhip-slack-staging DynamoDB table. Back up /
# confirm it is empty before applying.

module "songwhip_slack_sentry_project" {
  # checkov:skip=ORCD_AWS_2: Module retained only to allow orphaned sentry_project teardown; songwhip-slack decommissioned (AD-2916)
  source = "git@github.com:theorchard/terraform-sentry.git?ref=2.0.1"

  environment        = var.environment
  platform           = "javascript"
  service_name       = var.service_name
  application_family = var.application_family
}
