data "aws_caller_identity" "current" {}

locals {
  name = "${var.name_prefix}-${var.environment}"

  tags = {
    Environment = var.environment
    ManagedBy   = "terraform"
    Plane       = "aether"
    System      = "titan-lab"
  }

  paid_component_requests = compact([
    var.enable_external_backup_bucket ? "external-backup-bucket" : "",
  ])

  external_backup_bucket_name = lower(replace(
    "${local.name}-${data.aws_caller_identity.current.account_id}-${var.aws_region}-backup",
    "_",
    "-",
  ))
}
