Repository: aws-cloudformation/cfn-lint

Issue:
E2506 will fail when using default vpc
### CloudFormation Lint Version

latest

### What operating system are you using?

Mac

### Describe the bug

False positive for rule E2506 when using security group names with a default vpc

### Expected behavior

We should be able to specify a default security group name with a default vpc

### Reproduction template

```yaml
Resources:
  IngressRule:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: 'Security Group Vpc'
      VpcId: "vpc-default-id"
      SecurityGroupIngress:
      -
        IpProtocol: 1
        SourceSecurityGroupName: default
        FromPort: 0
        ToPort: 0

```


Discussion:

Resolving patch:
diff --git a/src/cfnlint/rules/resources/ectwo/SecurityGroupIngress.py b/src/cfnlint/rules/resources/ectwo/SecurityGroupIngress.py
deleted file mode 100644
--- a/src/cfnlint/rules/resources/ectwo/SecurityGroupIngress.py
+++ /dev/null
@@ -1,85 +0,0 @@
-"""
-Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
-SPDX-License-Identifier: MIT-0
-"""
-from cfnlint.rules import CloudFormationLintRule, RuleMatch
-
-
-class SecurityGroupIngress(CloudFormationLintRule):
-    """Check if EC2 Security Group Ingress Properties"""
-
-    id = "E2506"
-    shortdesc = "Resource EC2 Security Group Ingress Properties"
-    description = (
-        "See if EC2 Security Group Ingress Properties are set correctly. "
-        'Check that "SourceSecurityGroupId" or "SourceSecurityGroupName" are '
-        " are exclusive and using the type of Ref or GetAtt "
-    )
-    source_url = "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-ingress.html"
-    tags = ["resources", "ec2", "securitygroup"]
-
-    def check_ingress_rule(self, vpc_id, properties, path):
-        """Check ingress rule"""
-
-        matches = []
-        if vpc_id:
-            # Check that SourceSecurityGroupName isn't specified
-            if properties.get("SourceSecurityGroupName", None):
-                path_error = path[:] + ["SourceSecurityGroupName"]
-                message = (
-                    "SourceSecurityGroupName shouldn't be specified for "
-                    "Vpc Security Group at {0}"
-                )
-                matches.append(
-                    RuleMatch(
-                        path_error, message.format("/".join(map(str, path_error)))
-                    )
-                )
-
-        return matches
-
-    def match(self, cfn):
-        """Check EC2 Security Group Ingress Resource Parameters"""
-
-        matches = []
-
-        resources = cfn.get_resources(resource_type="AWS::EC2::SecurityGroup")
-        for resource_name, resource_object in resources.items():
-            properties = resource_object.get("Properties", {})
-            if properties:
-                vpc_id = properties.get("VpcId", None)
-                ingress_rules = properties.get("SecurityGroupIngress")
-                if isinstance(ingress_rules, list):
-                    for index, ingress_rule in enumerate(ingress_rules):
-                        path = [
-                            "Resources",
-                            resource_name,
-                            "Properties",
-                            "SecurityGroupIngress",
-                            index,
-                        ]
-                        matches.extend(
-                            self.check_ingress_rule(
-                                vpc_id=vpc_id, properties=ingress_rule, path=path
-                            )
-                        )
-
-        resources = None
-        resources = cfn.get_resources(resource_type="AWS::EC2::SecurityGroupIngress")
-        for resource_name, resource_object in resources.items():
-            properties = resource_object.get("Properties", {})
-            group_id = properties.get("GroupId", None)
-            path = ["Resources", resource_name, "Properties"]
-            if group_id:
-                vpc_id = "vpc-1234567"
-            else:
-                vpc_id = None
-
-            if properties:
-                path = ["Resources", resource_name, "Properties"]
-                matches.extend(
-                    self.check_ingress_rule(
-                        vpc_id=vpc_id, properties=properties, path=path
-                    )
-                )
-        return matches


Test patch:
diff --git a/test/unit/rules/resources/ec2/test_sg_ingress.py b/test/unit/rules/resources/ec2/test_sg_ingress.py
deleted file mode 100644
--- a/test/unit/rules/resources/ec2/test_sg_ingress.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
-Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
-SPDX-License-Identifier: MIT-0
-"""
-from test.unit.rules import BaseRuleTestCase
-
-from cfnlint.rules.resources.ectwo.SecurityGroupIngress import (
-    SecurityGroupIngress,  # pylint: disable=E0401
-)
-
-
-class TestPropertySgIngress(BaseRuleTestCase):
-    """Test Ec2 Security Group Ingress Rules"""
-
-    def setUp(self):
-        """Setup"""
-        super(TestPropertySgIngress, self).setUp()
-        self.collection.register(SecurityGroupIngress())
-        self.success_templates = [
-            "test/fixtures/templates/good/properties_ec2_vpc.yaml",
-        ]
-
-    def test_file_positive(self):
-        """Test Positive"""
-        self.helper_file_positive()
-
-    def test_file_negative(self):
-        """Test failure"""
-        self.helper_file_negative(
-            "test/fixtures/templates/bad/properties_sg_ingress.yaml", 1
-        )