### 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_
)
from localstack.config import external_service_url
from localstack.services.awslambda import lambda_api
from localstack.services.generic_proxy import RegionBackend
from localstack.services.moto import call_moto
from localstack.services.plugins import ServiceLifecycleHook
from localstack.utils.analytics import event_publisher
from localstack.utils.aws import aws_stack
from localstack.utils.aws.aws_responses import create_sqs_system_attributes, parse_urlencoded_data
from localstack.utils.aws.dead_letter_queue import sns_error_to_dead_letter_queue
from localstack.utils.cloudwatch.cloudwatch_util import store_cloudwatch_logs
from localstack.utils.json import json_safe
from localstack.utils.objects import not_none_or
from localstack.utils.strings import long_uid, md5, short_uid, to_bytes
from localstack.utils.threads import start_thread
from localstack.utils.time import timestamp_millis
SNS_PROTOCOLS = [
    "http",
    "https",
    "email",
    "email-json",
    "sms",
    "sqs",
    "application",
    "lambda",
    "firehose",
]
LOG = logging.getLogger(__name__)
GCM_URL = "https://fcm.googleapis.com/fcm/send"
class SNSBackend(RegionBackend):