module "slaughterhouse_custom_waf" {
  source            = "git@github.com:theorchard/terraform-aws-waf.git//?ref=1.5.0"
  environment       = var.environment
  service_name      = var.service_name
  aws_region        = var.aws_region
  count_waf_enabled = false
  block_waf_enabled = true

  excluded_rules = [
    "SizeRestrictions_BODY",
  ]
}

# Attach the WAF to the Slaughterhouse ALB.
resource "aws_wafv2_web_acl_association" "lb_waf_association" {
  resource_arn = aws_lb.slaughterhouse_lb.arn
  web_acl_arn  = module.slaughterhouse_custom_waf.waf_blocking_arn_output
}
