Validations for Events.CreateConnection
diff --git a/localstack/services/events/provider.py b/localstack/services/events/provider.py
index 03484d8549ca1..c9fc1c6b18aed 100644
--- a/localstack/services/events/provider.py
+++ b/localstack/services/events/provider.py
@@ -11,8 +11,13 @@
 
 from localstack import config
 from localstack.aws.api import RequestContext
+from localstack.aws.api.core import CommonServiceException
 from localstack.aws.api.events import (
     Boolean,
+    ConnectionAuthorizationType,
+    ConnectionDescription,
+    ConnectionName,
+    CreateConnectionAuthRequestParameters,
     EventBusNameOrArn,
     EventPattern,
     EventsApi,
@@ -41,6 +46,7 @@
 EVENTS_TMP_DIR = "cw_events"
 DEFAULT_EVENT_BUS_NAME = "default"
 CONTENT_BASE_FILTER_KEYWORDS = ["prefix", "anything-but", "numeric", "cidr", "exists"]
+CONNECTION_NAME_PATTERN = re.compile("^[\\.\\-_A-Za-z0-9]+$")
 
 
 class EventsProvider(EventsApi):
@@ -148,6 +154,37 @@ def disable_rule(
             JobScheduler.instance().disable_job(job_id=job_id)
         call_moto(context)
 
+    def create_connection(
+        self,
+        context: RequestContext,
+        name: ConnectionName,
+        authorization_type: ConnectionAuthorizationType,
+        auth_parameters: CreateConnectionAuthRequestParameters,
+        description: ConnectionDescription = None,
+    ):
+        errors = []
+
+        if not CONNECTION_NAME_PATTERN.match(name):
+            error = f"{name} at 'name' failed to satisfy: Member must satisfy regular expression pattern: [\\.\\-_A-Za-z0-9]+"
+            errors.append(error)
+
+        if len(name) > 64:
+            error = f"{name} at 'name' failed to satisfy: Member must have length less than or equal to 64"
+            errors.append(error)
+
+        if authorization_type not in ["BASIC", "API_KEY", "OAUTH_CLIENT_CREDENTIALS"]:
+            error = f"{authorization_type} at 'authorizationType' failed to satisfy: Member must satisfy enum value set: [BASIC, OAUTH_CLIENT_CREDENTIALS, API_KEY]"
+            errors.append(error)
+
+        if len(errors) > 0:
+            error_description = "; ".join(errors)
+            error_plural = "errors" if len(errors) > 1 else "error"
+            errors_amount = len(errors)
+            message = f"{errors_amount} validation {error_plural} detected: {error_description}"
+            raise CommonServiceException(message=message, code="ValidationException")
+
+        return call_moto(context)
+
 
 class EventsBackend(RegionBackend):
     # maps rule name to job_id
@@ -337,7 +374,7 @@ def filter_event(event_pattern_filter: Dict[str, Any], event: Dict[str, Any]):
                         if not handle_prefix_filtering(value.get(key_a), value_a):
                             return False
 
-            # 2. check if the pattern is a list and event values are not contained in it
+            # 2. check if the pattern is a list and event values are not contained in itEventsApi
             if isinstance(value, list):
                 if identify_content_base_parameter_in_pattern(value):
                     if not filter_event_with_content_base_parameter(value, event_value):
diff --git a/tests/integration/test_events.py b/tests/integration/test_events.py
index cc453061c2eb1..c862282ea3f22 100644
--- a/tests/integration/test_events.py
+++ b/tests/integration/test_events.py
@@ -7,6 +7,7 @@
 from typing import Dict, List, Tuple
 
 import pytest
+from botocore.exceptions import ClientError
 
 from localstack import config
 from localstack.services.awslambda.lambda_utils import LAMBDA_RUNTIME_PYTHON36
@@ -769,6 +770,25 @@ def check():
         # clean up
         proxy.stop()
 
+    def test_create_connection_validations(self, events_client):
+        connection_name = "This should fail with two errors 123467890123412341234123412341234"
+
+        with pytest.raises(ClientError) as ctx:
+            events_client.create_connection(
+                Name=connection_name,
+                AuthorizationType="INVALID",
+                AuthParameters={"BasicAuthParameters": {"Username": "user", "Password": "pass"}},
+            ),
+
+        assert ctx.value.response["ResponseMetadata"]["HTTPStatusCode"] == 400
+        assert ctx.value.response["Error"]["Code"] == "ValidationException"
+
+        message = ctx.value.response["Error"]["Message"]
+        assert "3 validation errors" in message
+        assert "must satisfy regular expression pattern" in message
+        assert "must have length less than or equal to 64" in message
+        assert "must satisfy enum value set: [BASIC, OAUTH_CLIENT_CREDENTIALS, API_KEY]" in message
+
     def test_put_events_with_target_firehose(self, events_client, s3_client, firehose_client):
         s3_bucket = "s3-{}".format(short_uid())
         s3_prefix = "testeventdata"

This PR addresses issue #5943 where is shown that Localstack doesn't validate the name parameter when creating a new Connection for the Events service, which could lead to several problems. 

Changes:
-  Validation for the Name parameter and the AuthorizationType.
- Test addition.
