terraform {
  backend "s3" {
    bucket         = "shieldai-staging-terraform-state"
    key            = "staging/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "shieldai-terraform-locks"
  }
}

module "shieldai" {
  source = "../.."

  environment     = "staging"
  aws_region      = "us-east-1"
  project_name    = "shieldai"
  vpc_cidr        = "10.0.0.0/16"
  az_count        = 2

  db_instance_class     = "db.t3.medium"
  db_multi_az           = false
  db_backup_retention   = 3

  elasticache_node_type = "cache.t3.small"
  elasticache_num_nodes = 1

  secrets = {
    HIBP_API_KEY = var.hibp_api_key
    RESEND_API_KEY = var.resend_api_key
    SENTRY_DSN   = var.sentry_dsn
    DATADOG_API_KEY = var.datadog_api_key
  }
}

variable "hibp_api_key" {
  description = "Have I Been Pwned API key"
  type        = string
  sensitive   = true
}

variable "resend_api_key" {
  description = "Resend API key"
  type        = string
  sensitive   = true
}

variable "sentry_dsn" {
  description = "Sentry DSN"
  type        = string
  sensitive   = true
}

variable "datadog_api_key" {
  description = "Datadog API key"
  type        = string
  sensitive   = true
}
