This template creates a stateful rule group to deny access to a specified domain using AWS Network Firewall.

Terraform Template

resource "aws_networkfirewall_rule_group" "example" {
  capacity = 100
  name = "example"

  rule_group {

    rules_source {

      rules_source_list {
        generated_rules_type = "DENYLIST"
        target_types = ["HTTP_HOST"]
        targets = ["test.example.com"]
      }
    }
  }

  tags = {
    Tag1 = "Value1"
    Tag2 = "Value2"
  }
  type = "STATEFUL"
}