Repository: localstack/localstack

Issue:
bug: lambda function invocation results in an error if we don't provide OnSuccess destination in the event invoke config
### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

Currently, lambda event invoke config expects to have both `OnSuccess` and `OnFailure` for the `DestinationConfig` and fails if we provide only `OnFailure` but not `OnSuccess` due to a flaw in the logic [here](https://github.com/localstack/localstack/blob/master/localstack/utils/aws/lambda_destinations.py#L40). 

Full response:
```
{"errorType": "AttributeError", "errorMessage": "'NoneType' object has no attribute 'split'", "stackTrace": [" File
\"/opt/code/localstack/localstack/services/awslambda/lambda_api.py\", line 752, in run_lambda\n
lock_discriminator=lock_discriminator,\n", " File
\"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 273, in execute\n return
do_execute()\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 263, in
do_execute\n return _run(func_arn=func_arn)\n", " File
\"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 157, in wrapped\n raise e\n", " File
\"/opt/code/localstack/localstack/utils/cloudwatch/cloudwatch_util.py\", line 153, in wrapped\n result = func(*args,
**kwargs)\n", " File \"/opt/code/localstack/localstack/services/awslambda/lambda_executors.py\", line 257, in _run\n
func_details, event, result, asynchronous, raised_error\n", " File
\"/opt/code/localstack/localstack/utils/aws/lambda_destinations.py\", line 40, in lambda_result_to_destination\n
send_event_to_target(func_details.on_successful_invocation, payload)\n", " File
\"/opt/code/localstack/localstack/utils/aws/aws_stack.py\", line 667, in send_event_to_target\n region =
target_arn.split(\":\")[3]\n"]}
```

### Expected Behavior

Not getting an error if we provide only `OnFailure` destination config in the event invoke config. Based on the [terraform docs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function_event_invoke_config#destination_config-configuration-block), it should be possible.

[Here](https://github.com/localstack/localstack/blob/master/localstack/utils/aws/lambda_destinations.py#L40) I would expect an `is not None` check for the `func_details.on_successful_invocation` to ensure that we are not passing a NoneType object to the `send_event_to_target` function.

### How are you starting LocalStack?

Custom (please describe below)

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

I am using a docker-compose + terraform setup with one lambda that has only `OnFailure` destination added to the `DestinationConfig` in the event invoke config. 

#### To reproduce the issue:
1. Create a lambda function
2. Create an event bus
3. Set up function event invoke config and add only `OnFailure` destination that's pointing to the arn of the event bus in the `DestinationConfig`
4. Invoke the lambda function

### Environment

```markdown
- OS: Ubuntu 20.04
- LocalStack: latest
```


### Anything else?

_No response_


Discussion:

Resolving patch:
diff --git a/localstack/utils/aws/lambda_destinations.py b/localstack/utils/aws/lambda_destinations.py
--- a/localstack/utils/aws/lambda_destinations.py
+++ b/localstack/utils/aws/lambda_destinations.py
@@ -37,4 +37,5 @@ def lambda_result_to_destination(func_details, event, result, is_async, error):
         send_event_to_target(func_details.on_failed_invocation, payload)
         return
 
-    send_event_to_target(func_details.on_successful_invocation, payload)
+    if func_details.on_successful_invocation is not None:
+        send_event_to_target(func_details.on_successful_invocation, payload)


Test patch: