Repository: localstack/localstack

Issue:
EventBridge not working with AWS Go SDK and edge-service
# Type of request: This is a ...
[X] bug report
[ ] feature request

# Detailed description
Using the AWS Go SDK (newest version, 1.35.31) doesn't work with LocalStack.

For me it looks like the AWS Go SDK sends an old or invalid Authorization header. Using the AWS CLI I can see the header looks like this: `....ZGQ/20201119/eu-central-1/events/aws4_request`

With the AWS Go SDK it looks like this: `....ZGQ/20201119/eu-central-1/EventBridge/aws4_request`

So it uses `EventBridge` instead of `events`, but LocalStack expects `events`.

I think this place must be enhanced, so that `EventBridge` will be mapped to `events`. If you like I can raise a PR.

## Expected behavior
I can use the AWS Go SDK for EventBridge.

## Actual behavior
I can't use the AWS Go SDK for EventBridge and always get an error with status-code 400.

Additionally I can find the following logs (DEBUG level is active):

```
2020-11-19T17:43:58:WARNING:localstack.services.edge: Unable to find listener for service "EventBridge" - please make sure to include it in $SERVICES
2020-11-19T17:43:58:WARNING:bootstrap.py: Thread run method <function AdaptiveThreadPool.submit.<locals>._run at 0x7f0be5f5ca60>(None) failed: Unable to find listener for service "EventBridge" - please make sure to include it in $SERVICES Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/bootstrap.py", line 578, in run
    result = self.func(self.params)
  File "/opt/code/localstack/localstack/utils/async_utils.py", line 28, in _run
    return fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 571, in handler
    response = modify_and_forward(method=method, path=path_with_params, data_bytes=data, headers=headers,
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 341, in modify_and_forward
    listener_result = listener.forward_request(method=method,
  File "/opt/code/localstack/localstack/services/edge.py", line 81, in forward_request
    return do_forward_request(api, port, method, path, data, headers)
  File "/opt/code/localstack/localstack/services/edge.py", line 86, in do_forward_request
    result = do_forward_request_inmem(api, port, method, path, data, headers)
  File "/opt/code/localstack/localstack/services/edge.py", line 100, in do_forward_request_inmem
    raise HTTPErrorResponse(message, code=400)
localstack.utils.server.http2_server.HTTPErrorResponse: Unable to find listener for service "EventBridge" - please make sure to include it in $SERVICES

2020-11-19T17:43:58:WARNING:localstack.utils.server.http2_server: Error in proxy handler for request POST http://localhost:33105/: Unable to find listener for service "EventBridge" - please make sure to include it in $SERVICES Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/server/http2_server.py", line 107, in index
    raise result
  File "/opt/code/localstack/localstack/utils/bootstrap.py", line 578, in run
    result = self.func(self.params)
  File "/opt/code/localstack/localstack/utils/async_utils.py", line 28, in _run
    return fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 571, in handler
    response = modify_and_forward(method=method, path=path_with_params, data_bytes=data, headers=headers,
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 341, in modify_and_forward
    listener_result = listener.forward_request(method=method,
  File "/opt/code/localstack/localstack/services/edge.py", line 81, in forward_request
    return do_forward_request(api, port, method, path, data, headers)
  File "/opt/code/localstack/localstack/services/edge.py", line 86, in do_forward_request
    result = do_forward_request_inmem(api, port, method, path, data, headers)
  File "/opt/code/localstack/localstack/services/edge.py", line 100, in do_forward_request_inmem
    raise HTTPErrorResponse(message, code=400)
localstack.utils.server.http2_server.HTTPErrorResponse: Unable to find listener for service "EventBridge" - please make sure to include it in $SERVICES
```

# Steps to reproduce
## Command used to start LocalStack
Docker container of LocalStack v0.12.2 with SERVICES='s3,sqs,events'

## Client code (AWS SDK code snippet, or sequence of "awslocal" commands)
```go
sess, _ = session.NewSession(&aws.Config{
	Region:           aws.String("eu-central-1"),
	Endpoint:         aws.String(localstackEndpoint),
	LogLevel:         aws.LogLevel(aws.LogDebugWithHTTPBody),
})

_, err = eventbridge.New(sess).PutRule(&eventbridge.PutRuleInput{
	Name:         aws.String("Test"),
})
```



┆Issue is synchronized with this [Jira Bug](https://localstack.atlassian.net/browse/LOC-332) by [Unito](https://www.unito.io/learn-more)



Discussion:

Resolving patch:
diff --git a/localstack/services/edge.py b/localstack/services/edge.py
--- a/localstack/services/edge.py
+++ b/localstack/services/edge.py
@@ -165,6 +165,8 @@ def get_api_from_headers(headers, path=None):
         result = result_before = 'dynamodbstreams', config.PORT_DYNAMODBSTREAMS
     elif ls_target == 'web':
         result = 'web', config.PORT_WEB_UI
+    elif result[0] == 'EventBridge':
+        result = 'events', config.PORT_EVENTS
 
     return result[0], result_before[1] or result[1], path, host
 


Test patch: