Repository: getmoto/moto (python)

Issue:
Resource Group cannot be deleted by ARN
### Description

boto allows deletion of a resource group by passing either a group name or an ARN to the `Group` parameter of [delete_group](https://boto3.amazonaws.com/v1/documentation/api/1.35.8/reference/services/resource-groups/client/delete_group.html)

### Example
```
import json
from unittest import TestCase

import boto3
from moto import mock_aws


@mock_aws
class TestMoto(TestCase):
    def test_resource_group_deletion(self):
        resource_groups_client = boto3.client('resource-groups')

        resource_group = resource_groups_client.create_group(
            Name='resource-group',
            ResourceQuery={
                "Type": "TAG_FILTERS_1_0",
                "Query": json.dumps(
                    {
                        "ResourceTypeFilters": ["AWS::AllSupported"],
                        "TagFilters": [
                            {"Key": "foo", "Values": ["bar"]}
                        ],
                    }
                ),
            }
        )

        resource_groups_client.delete_group(
            Group=resource_group['Group']['GroupArn']
        )
```

### Expectation
The resource group should be deleted.

This test works fine if I remove the `@mock_aws` annotation and run it against AWS

### Behaviour
A `KeyError` is raised:
```
KeyError: 'arn:aws:resource-groups:us-west-1:123456789012:resource-group'
```

Pull request:
ResourceGroups: support retrieval by the name or the ARN of the resource group
Closes #8921 

Patch:
diff --git a/moto/resourcegroups/exceptions.py b/moto/resourcegroups/exceptions.py
index 9a74f4651..63f084aae 100644
--- a/moto/resourcegroups/exceptions.py
+++ b/moto/resourcegroups/exceptions.py
@@ -6,3 +6,12 @@ class BadRequestException(JsonRESTError):
 
     def __init__(self, message: str):
         super().__init__(error_type="BadRequestException", message=message)
+
+
+class NotFoundException(JsonRESTError):
+    code = 404
+
+    def __init__(
+        self, message: str = "One or more of the specified resources don't exist."
+    ):
+        super().__init__(error_type="NotFoundException", message=message)
diff --git a/moto/resourcegroups/models.py b/moto/resourcegroups/models.py
index b4b45b7b3..98297bc34 100644
--- a/moto/resourcegroups/models.py
+++ b/moto/resourcegroups/models.py
@@ -6,7 +6,7 @@ from moto.core.base_backend import BackendDict, BaseBackend
 from moto.core.common_models import BaseModel
 from moto.utilities.utils import ARN_PARTITION_REGEX, get_partition
 
-from .exceptions import BadRequestException
+from .exceptions import BadRequestException, NotFoundException
 
 
 class FakeResourceGroup(BaseModel):
@@ -209,15 +209,22 @@ class ResourceGroups:
         self.by_arn: Dict[str, FakeResourceGroup] = {}
 
     def __contains__(self, item: str) -> bool:
-        return item in self.by_name
+        return item in self.by_name or item in self.by_arn
+
+    def __getitem__(self, item: str) -> FakeResourceGroup:
+        if item in self.by_name:
+            return self.by_name[item]
+        if item in self.by_arn:
+            return self.by_arn[item]
+        raise KeyError(f"Resource group '{item}' not found")
 
     def append(self, resource_group: FakeResourceGroup) -> None:
         self.by_name[resource_group.name] = resource_group
         self.by_arn[resource_group.arn] = resource_group
 
     def delete(self, name: str) -> FakeResourceGroup:
-        group = self.by_name[name]
-        del self.by_name[name]
+        group = self[name]
+        del self.by_name[group.name]
         del self.by_arn[group.arn]
         return group
 
@@ -330,10 +337,15 @@ class ResourceGroupsBackend(BaseBackend):
         return group
 
     def delete_group(self, group_name: str) -> FakeResourceGroup:
-        return self.groups.delete(name=group_name)
+        group = self.get_group(group_name)
+        return self.groups.delete(name=group.name)
 
     def get_group(self, group_name: str) -> FakeResourceGroup:
-        return self.groups.by_name[group_name]
+        try:
+            group = self.groups[group_name]
+        except KeyError:
+            raise NotFoundException()
+        return group
 
     def get_tags(self, arn: str) -> Dict[str, str]:
         return self.groups.by_arn[arn].tags


Test patch:
diff --git a/tests/test_resourcegroups/test_resourcegroups.py b/tests/test_resourcegroups/test_resourcegroups.py
index 800de6ddc..41e3f1b5a 100644
--- a/tests/test_resourcegroups/test_resourcegroups.py
+++ b/tests/test_resourcegroups/test_resourcegroups.py
@@ -1,6 +1,8 @@
 import json
 
 import boto3
+import pytest
+from botocore.exceptions import ClientError
 
 from moto import mock_aws
 
@@ -48,14 +50,35 @@ def test_delete_group():
     assert len(response["Groups"]) == 0
 
 
+@mock_aws
+def test_delete_group_by_arn():
+    resource_groups = boto3.client("resource-groups", region_name="us-east-1")
+
+    response = create_group(client=resource_groups)
+    group_arn = response["Group"]["GroupArn"]
+
+    response = resource_groups.delete_group(GroupName=group_arn)
+    assert group_arn == response["Group"]["GroupArn"]
+
+    with pytest.raises(ClientError) as exc:
+        resource_groups.get_group(GroupName=group_arn)
+    error = exc.value.response["Error"]
+    assert error["Code"] == "NotFoundException"
+
+
 @mock_aws
 def test_get_group():
     resource_groups = boto3.client("resource-groups", region_name="us-east-1")
 
-    create_group(client=resource_groups)
+    response = create_group(client=resource_groups)
+    group_name = response["Group"]["Name"]
+    group_arn = response["Group"]["GroupArn"]
 
-    response = resource_groups.get_group(GroupName="test_resource_group")
-    assert "description" in response["Group"]["Description"]
+    response = resource_groups.get_group(GroupName=group_name)
+    assert response["Group"]["GroupArn"] == group_arn
+
+    response = resource_groups.get_group(GroupName=group_arn)
+    assert response["Group"]["Name"] == group_name
 
 
 @mock_aws