waf.tf 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module "waf" {
  2. source = "../../../submodules/wafv2"
  3. # Custom to resource
  4. allowed_ips = [ ] # bypasses filters, so should not be needed/used unless warranted
  5. additional_blocked_ips = [ ] # NOTE: There is a standard list in the submodule
  6. resource_arn = aws_alb.jira_server_external.arn
  7. fqdns = concat( # first entry in list will be the WAF name
  8. keys(module.public_dns_record.forward),
  9. # example, to add additional valid hostnames
  10. # keys(module.public_dns_record_cust-auth-elb.forward),
  11. )
  12. # These are passed through and should be the same for module
  13. tags = merge(var.standard_tags, var.tags)
  14. aws_partition = var.aws_partition
  15. aws_region = var.aws_region
  16. aws_account_id = var.aws_account_id
  17. }
  18. # Example: If you want to attach the WAF to an additional ALB
  19. #
  20. # Share a WAF for both services, should be cheaper due to scale, but can be easily separated out
  21. # using the commented section below, if the need arises.
  22. #resource "aws_wafv2_web_acl_association" "associate-auth-to-waf" {
  23. # resource_arn = aws_lb.searchhead-auth-alb.arn
  24. # web_acl_arn = module.waf.web_acl_id
  25. #}
  26. # Example: If you want a second WAF, that should be straightforward
  27. #module "waf-auth" {
  28. # source = "../../../submodules/wafv2"
  29. #
  30. # # Custom to resource
  31. # allowed_ips = [ ] # bypasses filters, so should not be needed/used unless warranted
  32. # additional_blocked_ips = [ ] # NOTE: There is a standard list in the submodule
  33. # resource_arn = aws_lb.searchhead-auth-alb.arn
  34. # fqdns = keys(module.public_dns_record_cust-auth-elb.forward) # first entry in list will be the WAF name
  35. #
  36. # # These are passed through and should be the same for module
  37. # tags = merge(var.standard_tags, var.tags)
  38. # aws_partition = var.aws_partition
  39. # aws_region = var.aws_region
  40. # aws_account_id = var.aws_account_id
  41. #}