resource "aws_network_acl" "acl-0535c0da859c4e60e" {
  #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  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "6"
    to_port    = "65535"
  }

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

  subnet_ids = ["subnet-07f8721dc1b1630ee"]

  tags = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-RDS-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  tags_all = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-RDS-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  vpc_id = "vpc-09c83633eb7b315a2"
}

resource "aws_network_acl" "acl-0754f8e0fe53d03ae" {
  #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    = "6"
    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    = "5"
    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    = "7"
    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    = "8"
    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    = "2"
    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    = "9"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.0.0/16"
    from_port  = "22"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "3"
    to_port    = "22"
  }

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

  subnet_ids = ["subnet-01339d21a3eb86439", "subnet-0a6c0a3d10eced7a5", "subnet-0ae0493598d7bb35b", "subnet-0b0ef3c5c0dd96dcd", "subnet-0d19bfe513bcfd4bf", "subnet-09b0efb1258e0171b", "subnet-0ab97583b96611bd8"]

  tags = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-APP-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  tags_all = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-APP-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  vpc_id = "vpc-09c83633eb7b315a2"
}

resource "aws_network_acl" "acl-0c312aaec021129ea" {
  #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    = "2"
    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    = "5"
    to_port    = "0"
  }

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

  subnet_ids = ["subnet-05c45da01c1648f71", "subnet-08ecf11e742dfe0bd", "subnet-0d6a9d5c246706f58"]

  tags = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-PUB-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  tags_all = {
    Business-unit = "AMP Digital Archive"
    Environment   = "DEV2"
    Name          = "AMP-DIGARCH-D-PUB-NACL"
    Owner         = "Nathaniel Lovett"
    Project-code  = "SME-AMP"
    Project-name  = "AMP"
  }

  vpc_id = "vpc-09c83633eb7b315a2"
}

resource "aws_network_acl" "acl-0c83c5b8201a53d3a" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  vpc_id = "vpc-09c83633eb7b315a2"
}
