resource "aws_network_acl" "acl-01624b21da6ea41b6" {
  # checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  # checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "1"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "4"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "3"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "8"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "2"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.11.107.0/25"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "12"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.249.3.0/28"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "9"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.250.1.0/25"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "11"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.250.35.160/28"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "10"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "5"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.28.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "192.168.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "6"
    to_port    = "0"
  }

  subnet_ids = ["subnet-052b3abe1dd4e05b0", "subnet-07497781491f361b1", "subnet-0e919917644f728cb"]

  tags = {
    Name = "AOMA-S-PUB-NACL"
  }

  tags_all = {
    Name = "AOMA-S-PUB-NACL"
  }

  vpc_id = "vpc-0aa20ae4059ad2f09"
}

resource "aws_network_acl" "acl-085a093d39ae28e8e" {
  # checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  # checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "1"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "2"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "3"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "4"
    to_port    = "443"
  }

  ingress {
    action          = "allow"
    cidr_block      = "0.0.0.0/0"
    from_port       = "80"
    icmp_code       = "0"
    icmp_type       = "0"
    protocol        = "6"
    rule_no         = "5"
    to_port         = "80"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "6"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.29.30.0/24"
    from_port  = "6432"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "9"
    to_port    = "6432"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.12.0/27"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "10"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.21.0/25"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "11"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.28.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "12"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "192.168.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "8"
    to_port    = "0"
  }


  subnet_ids = ["subnet-01c5ce177dd81bc22", "subnet-03a0cf285badfdc64", "subnet-0881b826886cb97f0", "subnet-0b5a48b5835fc3935", "subnet-0bd6e967de4f78b99", "subnet-0dd89f02965c32573", "subnet-0ee5db461c576e715"]

  tags = {
    Name    = "AOMA-S-APP-NACL"
    Project = "AOMA"
  }

  tags_all = {
    Name    = "AOMA-S-APP-NACL"
    Project = "AOMA"
  }

  vpc_id = "vpc-0aa20ae4059ad2f09"
}

resource "aws_network_acl" "acl-0eec19d7552818533" {
  # checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "100"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "4"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "3"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "2"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.11.114.0/25"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.11.114.128/26"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "8"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.250.6.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "9"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.18.0/27"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "6"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.23.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "10"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.28.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "5"
    to_port    = "0"
  }

  subnet_ids = ["subnet-019922b244bb2f41c", aws_subnet.AOMA-S-XRDS-1A.id, aws_subnet.AOMA-S-XRDS-1B.id]

  tags = {
    Name    = "AOMA-S-RDS-NACL"
    Project = "AOMA"
  }

  tags_all = {
    Name    = "AOMA-S-RDS-NACL"
    Project = "AOMA"
  }

  vpc_id = "vpc-0aa20ae4059ad2f09"
}

resource "aws_network_acl" "acl-0f4435bfc0345e46d" {
  # checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  tags = {
    Name = "AOMA-S-DEFAULT-NACL"
  }

  tags_all = {
    Name = "AOMA-S-DEFAULT-NACL"
  }

  vpc_id = "vpc-0aa20ae4059ad2f09"
}
