### Is there an existing issue for this?

- [X] I have searched the existing issues and read the documentation

### Question

### Issue
I deployed jar as lambda function in localstack triggered by SNS Event. I published a compressed payload to SNS topic which triggered my lambda function. During runtime, SNS Event to my lambda handler comes with message attribute by name Format Type. While extracting SNSEvent.MessageAttribute, the object is coming as LinkedHashMap and am getting an exception

### Exception Message
 Exception in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.amazonaws.services.lambda.runtime.events.SNSEvent$MessageAttribute (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.amazonaws.services.lambda.runtime.events.SNSEvent$MessageAttribute is in unnamed module of loader 'app')

### IDE screenshot
<img width="1104" alt="Screen Shot 2022-06-09 at 10 11 17 PM" src="https://user-images.githubusercontent.com/11893250/172999694-24a1f879-3a4f-45d4-8a94-98c325d61334.png">



### Anything else?

_No response_
subscription_attributes = sns_client.get_subscription_attributes(
            SubscriptionArn=http_subscription_arn
        )
        assert subscription_attributes["Attributes"]["PendingConfirmation"] == "false"
        server.stop()
        wait_for_port_closed(server.port)
        message = "test_dlq_external_http_endpoint"
        sns_client.publish(TopicArn=topic_arn, Message=message)
        response = sqs_client.receive_message(QueueUrl=dlq_url, WaitTimeSeconds=3)
        assert (
            len(response["Messages"]) == 1
        ), f"invalid number of messages in DLQ response {response}"
        if raw_message_delivery:
            assert response["Messages"][0]["Body"] == message
        else:
            received_message = json.loads(response["Messages"][0]["Body"])
            assert received_message["Type"] == "Notification"
            assert received_message["Message"] == message
        receipt_handle = response["Messages"][0]["ReceiptHandle"]
        sqs_client.delete_message(QueueUrl=dlq_url, ReceiptHandle=receipt_handle)
        expected_unsubscribe_url = (
            f"{service_url}/?Action=Unsubscribe&SubscriptionArn={http_subscription_arn}"
        )
        unsub_request = requests.get(expected_unsubscribe_url)
        unsubscribe_confirmation = xmltodict.parse(unsub_request.content)
        assert "UnsubscribeResponse" in unsubscribe_confirmation
        response = sqs_client.receive_message(QueueUrl=dlq_url, WaitTimeSeconds=2)
        # A
        assert "Messages" not in response
    def test_publish_too_long_message(self, sns_client):