Repository: localstack/localstack

Issue:
bug: SES Events notification messages are missing property tags
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

This is a follow up to these PR from @simonrw https://github.com/localstack/localstack/pull/7244 and https://github.com/localstack/localstack/pull/7207

Setting up a configuration set for SES enables us  to receive event notification from SES when different events happen (sent, delivered, bounced, opened etc) 

The implementation in Localstack to mimic this behaviour was recently merged in the mentioned PR, but not all the properties from the payload are present. One property we would need are tags, specifically the custom tags which can be attached with the email request in order to better process the events later.

For example this email request:

```
aws ses send-email --destination '{"ToAddresses”:[“xxx@xxxcom"]}' --message '{"Subject":{"Data":"Test Link"},"Body":{"Html":{"Data":"<a href=\"nba.com\">Link test</a>"}}}' --configuration-set-name ses_config_set --from ‘yyy@oyyycom' --region eu-central-1 --tags Name=identifier,Value=testidentifier --output table | cat
````

Should generate events that contains the custom tag "Identifier" (among other generic tags from SES)

In real AWS:

```
{
   "Type":"Notification",
   "MessageId":"91873157-d824-57d9-8228-6d457e4cd029",
   "TopicArn":"arn:aws:sns:eu-central-1:736957585402:ses_events_topic",
   "Subject":"Amazon SES Email Event Notification",
   "Message":"{\"eventType\":\"Delivery\",\"mail\":{\"timestamp\":\"2022-12-13T16:11:19.531Z\",\"source\":\"xxx\",\"sourceArn\":\"arn:aws:ses:eu-central-1:736957585402:identity/xxx\",\"sendingAccountId\":\"736957585402\",\"messageId\":\"010701850c413a6b-9f7f1f77-2ec7-44b1-80a3-4d2c840d67a2-000000\",\"destination\":[\"yyy@gmail.com\"],\"headersTruncated\":false,\"headers\":[{\"name\":\"From\",\"value\":\"xxx\"},{\"name\":\"To\",\"value\":\"yyy@gmail.com\"},{\"name\":\"Subject\",\"value\":\"Test Link\"},{\"name\":\"MIME-Version\",\"value\":\"1.0\"},{\"name\":\"Content-Type\",\"value\":\"text/html; charset=UTF-8\"},{\"name\":\"Content-Transfer-Encoding\",\"value\":\"7bit\"}],\"commonHeaders\":{\"from\":[\"xxx\"],\"to\":[\"yyy@gmail.com\"],\"messageId\":\"010701850c413a6b-9f7f1f77-2ec7-44b1-80a3-4d2c840d67a2-000000\",\"subject\":\"Test Link\"},\"tags\":{\"identifier\":[\"testidentifier\"],\"ses:operation\":[\"SendEmail\"],\"ses:configuration-set\":[\"ses_config_set\"],\"ses:source-ip\":[\"3.68.108.181\"],\"ses:from-domain\":[\"yyy.com\"],\"ses:caller-identity\":[\"nw-admin\"],\"ses:outgoing-ip\":[\"69.169.224.1\"]}},\"delivery\":{\"timestamp\":\"2022-12-13T16:11:20.279Z\",\"processingTimeMillis\":748,\"recipients\":[\"yyy@gmail.com\"],\"smtpResponse\":\"250 2.0.0 OK  1670947880 6-20020a056000156600b00236c23d73ddsi99176wrz.662 - gsmtp\",\"reportingMTA\":\"b224-1.smtp-out.eu-central-1.amazonses.com\"}}\n",
   "Timestamp":"2022-12-13T16:11:20.388Z",
   "SignatureVersion":"1",
   "Signature":"C3BAipDonFzymok4kMnj7rwZFxi4447VQNZLpy8TApeSY/FZaN9WS4YtALDQvTiWANMk8ad/hbVrrNtzN90xZNJVNlCiDFA1g9qkFrzwZ7/2UNhQSIStHmsQbGTxGZybv8SucCz3OZlFrTqYyQg8RsgUtke0+BgWJErFAAWszd1ActeGjFTLUY3vwSBIUe7zkJakEqzg+XndjU+IjtBBEgI31reIhrTlYPvlvABLi8SeyvB04dvH5Uekshw5rbYe12556vYzqA6N8Kd1n3J+BMK/mIPUcYeMC/PMmzTpeOWaov7v65dkZtrJD4sTvLx5wCIBeiwod2UI4pttId2Zug==",
   "SigningCertURL":"https://sns.eu-central-1.amazonaws.com/SimpleNotificationService-56e67fcb41f6fec09b0196692625d385.pem",
   "UnsubscribeURL":"https://sns.eu-central-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:736957585402:ses_events_topic:c5810a4e-f8e6-41a6-bfca-b5b7e9dfe33e"
}
```
Currently in Localstack:

```
{
   "Type":"Notification",
   "MessageId":"1d579434-7249-415f-87cf-c25be7105d31",
   "TopicArn":"arn:aws:sns:eu-central-1:000000000000:ses_events_topic",
   "Message":"{\"eventType\": \"Delivery\", \"mail\": {\"timestamp\": \"2022-12-13T15:56:04.071889+00:00\", \"source\": \"Sender <sender@test.com>\", \"sourceArn\": \"arn:aws:ses:eu-central-1:000000000000:identity/Sender <sender@test.com>\", \"sendingAccountId\": \"000000000000\", \"destination\": [\"Recipient <recipient@test.com>\"], \"messageId\": \"ytjtivdqeyygqyhj-dxkcrufx-tppt-hinv-ohqa-qzdyybhobphe-owevcr\"}, \"delivery\": {\"recipients\": [\"Recipient <recipient@test.com>\"], \"timestamp\": \"2022-12-13T15:56:04.071889+00:00\"}}",
   "Timestamp":"2022-12-13T15:56:04.088Z",
   "SignatureVersion":"1",
   "Signature":"EXAMPLEpH+..",
   "SigningCertURL":"https://sns.us-east-1.amazonaws.com/SimpleNotificationService-0000000000000000000000.pem",
   "UnsubscribeURL":"http://localhost:4566/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-central-1:000000000000:ses_events_topic:b8d988ba-62c9-4c2c-8857-74984bdbe26b",
   "Subject":"Amazon SES Email Event Notification"
}
```

### Expected Behavior

The SES event notification payload should include tags, specially the custom ones. ("identifier", in this case)

```
"tags\":{\"identifier\":[\"testidentifier\"],\"ses:operation\":[\"SendEmail\"],\"ses:configuration-set\":[\"ses_config_set\"],\"ses:source-ip\":[\"33.61.18.181\"],\"ses:from-domain\":[\"yyy.com\"],\"ses:caller-identity\":[\"xx-admin\"],\"ses:outgoing-ip\":[\"79.143.224.1\"]}},
```

### How are you starting LocalStack?

With a docker-compose file

### Steps To Reproduce

```

services:
  localstack:
    image: localstack/localstack:latest
    environment:
      - SERVICES=sqs,sns,ses
      - AWS_DEFAULT_REGION=eu-central-1
      - EDGE_PORT=4566
    ports:
      - '4566-4597:4566-4597'
    volumes:
      - ./localstack_setup.sh:/docker-entrypoint-initaws.d/setup.sh
      - '${TMPDIR:-/tmp/localstack}:/tmp/localstack'
      - '/var/run/docker.sock:/var/run/docker.sock'
networks:
  default:
    name: development-network
    external: true
```
**Verify email address**

`aws --endpoint-url=http://localhost:4566 ses verify-email-identity --email-address sender@test.com --profile test-profile --region eu-central-1 --output table | cat`

**create queue for SNS - SES events**

```
aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name ses_emails_feedback_queue
 --attributes '{"SqsManagedSseEnabled": "false"}' --profile test-profile --region eu-central-1 --output table | cat
```

**create SNS topic for SES events**

`aws --endpoint-url=http://localhost:4566 sns create-topic --name ses_events_topic --region eu-central-1 --profile test-profile --output table`

**subscribe queue to topic**

`aws --endpoint-url=http://localhost:4566 sns subscribe --topic-arn arn:aws:sns:eu-central-1:000000000000:ses_events_topic --protocol sqs --notification-endpoint arn:aws:sqs:eu-central-1:000000000000:ses_emails_feedback_queue --profile test-profile --region eu-central-1 --output table | cat`

**create config set**

`aws --endpoint-url=http://localhost:4566 ses create-configuration-set --configuration-set "{\"Name\":\"ses_config_set\"}" --profile test-profile --region eu-central-1 --output table | cat`

**create event destination**

`aws --endpoint-url=http://localhost:4566 ses create-configuration-set-event-destination --configuration-set-name ses_config_set --event-destination '{"Name":"some_name2","Enabled":true,"MatchingEventTypes":["send","bounce","delivery","open","click"],"SNSDestination":{"TopicARN":"arn:aws:sns:eu-central-1:000000000000:ses_events_topic"}}' --profile test-profile --region eu-central-1 --output table | cat`


**Send email with custom tag included:**

`aws --endpoint-url=http://localhost:4566 ses  send-email --destination '{"ToAddresses”:[“xxx@xxx.com"]}' --message '{"Subject":{"Data":"Test Link"},"Body":{"Html":{"Data":"<a href=\"nba.com\">Link test</a>"}}}' --configuration-set-name ses_config_set --from ‘sender@test.com' --region eu-central-1 --tags Name=identifier,Value=testidentifier --output table | cat`




### Environment

```markdown
- OS: macOS 12.6.1
- LocalStack: "1.3.0.dev"
```


### Anything else?

_No response_


Discussion:

Resolving patch:
diff --git a/localstack/services/ses/provider.py b/localstack/services/ses/provider.py
--- a/localstack/services/ses/provider.py
+++ b/localstack/services/ses/provider.py
@@ -2,6 +2,7 @@
 import json
 import logging
 import os
+from collections import defaultdict
 from datetime import date, datetime, time, timezone
 from typing import TYPE_CHECKING, Any, Dict, Optional
 
@@ -317,6 +318,7 @@ def send_email(
                 message_id=response["MessageId"],
                 sender_email=source,
                 destination_addresses=destination["ToAddresses"],
+                tags=tags,
             )
             emitter.emit_send_event(payload, sns_destination_arn)
             emitter.emit_delivery_event(payload, sns_destination_arn)
@@ -367,6 +369,7 @@ def send_templated_email(
                 message_id=response["MessageId"],
                 sender_email=source,
                 destination_addresses=destination["ToAddresses"],
+                tags=tags,
             )
             emitter.emit_send_event(payload, sns_destination_arn, emit_source_arn=False)
             emitter.emit_delivery_event(payload, sns_destination_arn)
@@ -425,6 +428,7 @@ def send_raw_email(
                 message_id=response["MessageId"],
                 sender_email=source,
                 destination_addresses=destinations,
+                tags=tags,
             )
             emitter.emit_send_event(payload, sns_destination_arn)
             emitter.emit_delivery_event(payload, sns_destination_arn)
@@ -462,6 +466,7 @@ class SNSPayload:
     message_id: str
     sender_email: Address
     destination_addresses: AddressList
+    tags: Optional[MessageTagList]
 
 
 class SNSEmitter:
@@ -493,6 +498,10 @@ def emit_send_event(
     ):
         now = datetime.now(tz=timezone.utc)
 
+        tags = defaultdict(list)
+        for every in payload.tags or []:
+            tags[every["Name"]].append(every["Value"])
+
         event_payload = {
             "eventType": "Send",
             "mail": {
@@ -501,6 +510,7 @@ def emit_send_event(
                 "sendingAccountId": self.context.account_id,
                 "destination": payload.destination_addresses,
                 "messageId": payload.message_id,
+                "tags": tags,
             },
             "send": {},
         }
@@ -523,6 +533,10 @@ def emit_send_event(
     def emit_delivery_event(self, payload: SNSPayload, sns_topic_arn: str):
         now = datetime.now(tz=timezone.utc)
 
+        tags = defaultdict(list)
+        for every in payload.tags or []:
+            tags[every["Name"]].append(every["Value"])
+
         event_payload = {
             "eventType": "Delivery",
             "mail": {
@@ -532,6 +546,7 @@ def emit_delivery_event(self, payload: SNSPayload, sns_topic_arn: str):
                 "sendingAccountId": self.context.account_id,
                 "destination": payload.destination_addresses,
                 "messageId": payload.message_id,
+                "tags": tags,
             },
             "delivery": {
                 "recipients": payload.destination_addresses,


Test patch:
diff --git a/tests/integration/test_ses.py b/tests/integration/test_ses.py
--- a/tests/integration/test_ses.py
+++ b/tests/integration/test_ses.py
@@ -1,7 +1,7 @@
 import json
 import os
 from datetime import date, datetime
-from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, Optional, Tuple
 
 import pytest
 import requests
@@ -37,6 +37,38 @@ def _create_template(Template):
         ses_client.delete_template(TemplateName=name)
 
 
+@pytest.fixture
+def setup_email_addresses(ses_verify_identity):
+    """
+    If the test is running against AWS then assume the email addresses passed are already
+    verified, and passes the given email addresses through. Otherwise, it generates two random
+    email addresses and verifies them.
+    """
+
+    def inner(
+        sender_email_address: Optional[str] = None, recipient_email_address: Optional[str] = None
+    ) -> Tuple[str, str]:
+        if os.getenv("TEST_TARGET") == "AWS_CLOUD":
+            if sender_email_address is None:
+                raise ValueError(
+                    "sender_email_address must be specified to run this test against AWS"
+                )
+            if recipient_email_address is None:
+                raise ValueError(
+                    "recipient_email_address must be specified to run this test against AWS"
+                )
+        else:
+            # overwrite the given parameters with localstack specific ones
+            sender_email_address = f"sender-{short_uid()}@example.com"
+            recipient_email_address = f"recipient-{short_uid()}@example.com"
+            ses_verify_identity(sender_email_address)
+            ses_verify_identity(recipient_email_address)
+
+        return sender_email_address, recipient_email_address
+
+    return inner
+
+
 def sort_mail_sqs_messages(message):
     if "Successfully validated" in message["Message"]:
         return 0
@@ -242,6 +274,7 @@ def test_clone_receipt_rule_set(self, ses_client):
         assert [x["Name"] for x in rule_set["Rules"]] == rule_names
 
     @pytest.mark.only_localstack
+    @pytest.mark.aws_validated
     @pytest.mark.skip_snapshot_verify(
         paths=[
             "$..Message.delivery.processingTimeMillis",
@@ -250,7 +283,12 @@ def test_clone_receipt_rule_set(self, ses_client):
             "$..Message.mail.commonHeaders",
             "$..Message.mail.headers",
             "$..Message.mail.headersTruncated",
-            "$..Message.mail.tags",
+            "$..Message.mail.tags.'ses:caller-identity'",
+            "$..Message.mail.tags.'ses:configuration-set'",
+            "$..Message.mail.tags.'ses:from-domain'",
+            "$..Message.mail.tags.'ses:operation'",
+            "$..Message.mail.tags.'ses:outgoing-ip'",
+            "$..Message.mail.tags.'ses:source-ip'",
             "$..Message.mail.timestamp",
         ]
     )
@@ -262,17 +300,17 @@ def test_ses_sns_topic_integration_send_email(
         sns_create_sqs_subscription,
         ses_configuration_set,
         ses_configuration_set_sns_event_destination,
-        ses_verify_identity,
         sqs_receive_num_messages,
+        setup_email_addresses,
         snapshot,
     ):
         """
         Repro for #7184 - test that this test is not runnable in the sandbox account since it
-        requires a
-        validated email address. We do not have support for this yet.
+        requires a validated email address. We do not have support for this yet.
         """
-        sender_email_address = f"repro-7184-{short_uid()}@example.com"
-        recipient_email_address = f"repro-7184-{short_uid()}@example.com"
+
+        # add your email addresses in here to verify against AWS
+        sender_email_address, recipient_email_address = setup_email_addresses()
 
         snapshot.add_transformers_list(
             [
@@ -283,9 +321,6 @@ def test_ses_sns_topic_integration_send_email(
             + snapshot.transform.sns_api()
         )
 
-        ses_verify_identity(sender_email_address)
-        ses_verify_identity(recipient_email_address)
-
         # create queue to listen for SES -> SNS events
         topic_arn = sns_topic["Attributes"]["TopicArn"]
         sns_create_sqs_subscription(topic_arn=topic_arn, queue_url=sqs_queue)
@@ -317,6 +352,12 @@ def test_ses_sns_topic_integration_send_email(
             Message=message,
             ConfigurationSetName=config_set_name,
             Source=sender_email_address,
+            Tags=[
+                {
+                    "Name": "custom-tag",
+                    "Value": "tag-value",
+                }
+            ],
         )
 
         messages = sqs_receive_num_messages(sqs_queue, 3)
@@ -324,6 +365,7 @@ def test_ses_sns_topic_integration_send_email(
         snapshot.match("messages", messages)
 
     @pytest.mark.only_localstack
+    @pytest.mark.aws_validated
     @pytest.mark.skip_snapshot_verify(
         paths=[
             "$..Message.delivery.processingTimeMillis",
@@ -332,7 +374,12 @@ def test_ses_sns_topic_integration_send_email(
             "$..Message.mail.commonHeaders",
             "$..Message.mail.headers",
             "$..Message.mail.headersTruncated",
-            "$..Message.mail.tags",
+            "$..Message.mail.tags.'ses:caller-identity'",
+            "$..Message.mail.tags.'ses:configuration-set'",
+            "$..Message.mail.tags.'ses:from-domain'",
+            "$..Message.mail.tags.'ses:operation'",
+            "$..Message.mail.tags.'ses:outgoing-ip'",
+            "$..Message.mail.tags.'ses:source-ip'",
             "$..Message.mail.timestamp",
         ]
     )
@@ -342,15 +389,15 @@ def test_ses_sns_topic_integration_send_templated_email(
         ses_configuration_set,
         ses_configuration_set_sns_event_destination,
         ses_email_template,
-        ses_verify_identity,
         sns_create_sqs_subscription,
         sns_create_topic,
         sqs_queue,
         sqs_receive_num_messages,
+        setup_email_addresses,
         snapshot,
     ):
-        sender_email_address = f"repro-7184-{short_uid()}@example.com"
-        recipient_email_address = f"repro-7184-{short_uid()}@example.com"
+        # add your email addresses in here to verify against AWS
+        sender_email_address, recipient_email_address = setup_email_addresses()
 
         snapshot.add_transformers_list(
             [
@@ -361,9 +408,6 @@ def test_ses_sns_topic_integration_send_templated_email(
             + snapshot.transform.sns_api()
         )
 
-        ses_verify_identity(sender_email_address)
-        ses_verify_identity(recipient_email_address)
-
         template_name = f"template-{short_uid()}"
         ses_email_template(template_name, "Test template")
 
@@ -389,6 +433,12 @@ def test_ses_sns_topic_integration_send_templated_email(
             TemplateData=json.dumps({}),
             ConfigurationSetName=config_set_name,
             Source=sender_email_address,
+            Tags=[
+                {
+                    "Name": "custom-tag",
+                    "Value": "tag-value",
+                }
+            ],
         )
 
         messages = sqs_receive_num_messages(sqs_queue, 3)
@@ -396,6 +446,7 @@ def test_ses_sns_topic_integration_send_templated_email(
         snapshot.match("messages", messages)
 
     @pytest.mark.only_localstack
+    @pytest.mark.aws_validated
     @pytest.mark.skip_snapshot_verify(
         paths=[
             "$..Message.delivery.processingTimeMillis",
@@ -404,7 +455,12 @@ def test_ses_sns_topic_integration_send_templated_email(
             "$..Message.mail.commonHeaders",
             "$..Message.mail.headers",
             "$..Message.mail.headersTruncated",
-            "$..Message.mail.tags",
+            "$..Message.mail.tags.'ses:caller-identity'",
+            "$..Message.mail.tags.'ses:configuration-set'",
+            "$..Message.mail.tags.'ses:from-domain'",
+            "$..Message.mail.tags.'ses:operation'",
+            "$..Message.mail.tags.'ses:outgoing-ip'",
+            "$..Message.mail.tags.'ses:source-ip'",
             "$..Message.mail.timestamp",
         ]
     )
@@ -413,15 +469,15 @@ def test_ses_sns_topic_integration_send_raw_email(
         ses_client,
         ses_configuration_set,
         ses_configuration_set_sns_event_destination,
-        ses_verify_identity,
         sns_create_sqs_subscription,
         sns_create_topic,
         sqs_queue,
         sqs_receive_num_messages,
+        setup_email_addresses,
         snapshot,
     ):
-        sender_email_address = f"repro-7184-{short_uid()}@example.com"
-        recipient_email_address = f"repro-7184-{short_uid()}@example.com"
+        # add your email addresses in here to verify against AWS
+        sender_email_address, recipient_email_address = setup_email_addresses()
 
         snapshot.add_transformers_list(
             [
@@ -432,9 +488,6 @@ def test_ses_sns_topic_integration_send_raw_email(
             + snapshot.transform.sns_api()
         )
 
-        ses_verify_identity(sender_email_address)
-        ses_verify_identity(recipient_email_address)
-
         # create queue to listen for SES -> SNS events
         topic_arn = sns_create_topic()["TopicArn"]
         sns_create_sqs_subscription(topic_arn=topic_arn, queue_url=sqs_queue)
@@ -455,6 +508,12 @@ def test_ses_sns_topic_integration_send_raw_email(
             },
             ConfigurationSetName=config_set_name,
             Source=sender_email_address,
+            Tags=[
+                {
+                    "Name": "custom-tag",
+                    "Value": "tag-value",
+                }
+            ],
         )
 
         messages = sqs_receive_num_messages(sqs_queue, 3)
@@ -513,16 +572,14 @@ def test_sending_to_deleted_topic(
         sns_client,
         sns_topic,
         sns_wait_for_topic_delete,
-        ses_verify_identity,
         ses_configuration_set,
         sqs_receive_num_messages,
         ses_configuration_set_sns_event_destination,
+        setup_email_addresses,
         snapshot,
     ):
-        recipient_email_address = "recipient@example.com"
-        sender_email_address = "sender@example.com"
-        ses_verify_identity(sender_email_address)
-        ses_verify_identity(recipient_email_address)
+        # add your email addresses in here to verify against AWS
+        sender_email_address, recipient_email_address = setup_email_addresses()
 
         snapshot.add_transformers_list(
             [
diff --git a/tests/integration/test_ses.snapshot.json b/tests/integration/test_ses.snapshot.json
--- a/tests/integration/test_ses.snapshot.json
+++ b/tests/integration/test_ses.snapshot.json
@@ -1,6 +1,6 @@
 {
   "tests/integration/test_ses.py::TestSES::test_ses_sns_topic_integration_send_email": {
-    "recorded-date": "28-11-2022, 11:48:20",
+    "recorded-date": "14-12-2022, 17:29:13",
     "recorded-content": {
       "messages": [
         {
@@ -72,7 +72,7 @@
                   "SendEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-b022b370"
+                  "config-set-88be5780"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
@@ -80,6 +80,9 @@
                 "ses:from-domain": [
                   "gmail.com"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ]
@@ -151,7 +154,7 @@
                   "SendEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-b022b370"
+                  "config-set-88be5780"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
@@ -159,22 +162,25 @@
                 "ses:from-domain": [
                   "gmail.com"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ],
                 "ses:outgoing-ip": [
-                  "69.169.224.10"
+                  "69.169.224.8"
                 ]
               }
             },
             "delivery": {
               "timestamp": "date",
-              "processingTimeMillis": 623,
+              "processingTimeMillis": 1167,
               "recipients": [
                 "<recipient-email-address>"
               ],
-              "smtpResponse": "250 2.0.0 OK  1669636100 n20-20020a05600c501400b003cf484ba59dsi10504395wmr.122 - gsmtp",
-              "reportingMTA": "b224-10.smtp-out.<region>.amazonses.com"
+              "smtpResponse": "250 2.0.0 OK  1671038953 v10-20020adfa1ca000000b00241d1ecc8c6si1900057wrv.541 - gsmtp",
+              "reportingMTA": "b224-8.smtp-out.<region>.amazonses.com"
             }
           },
           "Timestamp": "date",
@@ -187,7 +193,7 @@
     }
   },
   "tests/integration/test_ses.py::TestSES::test_ses_sns_topic_integration_send_templated_email": {
-    "recorded-date": "28-11-2022, 11:48:15",
+    "recorded-date": "14-12-2022, 17:29:16",
     "recorded-content": {
       "messages": [
         {
@@ -245,7 +251,7 @@
                   "SendTemplatedEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-8ed3500d"
+                  "config-set-c17e0219"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
@@ -253,6 +259,9 @@
                 "ses:from-domain": [
                   "gmail.com"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ]
@@ -286,7 +295,7 @@
               "headers": [
                 {
                   "name": "Date",
-                  "value": "Mon, 28 Nov 2022 11:48:14 +0000"
+                  "value": "Wed, 14 Dec 2022 17:29:15 +0000"
                 },
                 {
                   "name": "From",
@@ -298,11 +307,11 @@
                 },
                 {
                   "name": "Message-ID",
-                  "value": "<1253528252.927764.1669636094798@ip-10-0-171-26.<region>.compute.internal>"
+                  "value": "<1786912680.12997.1671038955596@ip-10-0-189-31.<region>.compute.internal>"
                 },
                 {
                   "name": "Subject",
-                  "value": "Email template 30e6086e"
+                  "value": "Email template e16fc3f7"
                 },
                 {
                   "name": "MIME-Version",
@@ -321,19 +330,19 @@
                 "from": [
                   "<sender-email-address>"
                 ],
-                "date": "Mon, 28 Nov 2022 11:48:14 +0000",
+                "date": "Wed, 14 Dec 2022 17:29:15 +0000",
                 "to": [
                   "<recipient-email-address>"
                 ],
                 "messageId": "<message-id:1>",
-                "subject": "Email template 30e6086e"
+                "subject": "Email template e16fc3f7"
               },
               "tags": {
                 "ses:operation": [
                   "SendTemplatedEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-8ed3500d"
+                  "config-set-c17e0219"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
@@ -341,22 +350,25 @@
                 "ses:from-domain": [
                   "gmail.com"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ],
                 "ses:outgoing-ip": [
-                  "69.169.224.12"
+                  "69.169.224.10"
                 ]
               }
             },
             "delivery": {
               "timestamp": "date",
-              "processingTimeMillis": 776,
+              "processingTimeMillis": 800,
               "recipients": [
                 "<recipient-email-address>"
               ],
-              "smtpResponse": "250 2.0.0 OK  1669636095 g2-20020a5d64e2000000b0024165c0a6a1si8609938wri.49 - gsmtp",
-              "reportingMTA": "b224-12.smtp-out.<region>.amazonses.com"
+              "smtpResponse": "250 2.0.0 OK  1671038956 b13-20020adfde0d000000b0022ac0f59416si1880444wrm.732 - gsmtp",
+              "reportingMTA": "b224-10.smtp-out.<region>.amazonses.com"
             }
           },
           "Timestamp": "date",
@@ -369,7 +381,7 @@
     }
   },
   "tests/integration/test_ses.py::TestSES::test_ses_sns_topic_integration_send_raw_email": {
-    "recorded-date": "28-11-2022, 11:49:35",
+    "recorded-date": "14-12-2022, 17:29:18",
     "recorded-content": {
       "messages": [
         {
@@ -409,11 +421,14 @@
                   "SendRawEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-0faf5da7"
+                  "config-set-20c4c21e"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ]
@@ -453,27 +468,30 @@
                   "SendRawEmail"
                 ],
                 "ses:configuration-set": [
-                  "config-set-0faf5da7"
+                  "config-set-20c4c21e"
                 ],
                 "ses:source-ip": [
                   "80.189.216.182"
                 ],
+                "custom-tag": [
+                  "tag-value"
+                ],
                 "ses:caller-identity": [
                   "localstack-testing"
                 ],
                 "ses:outgoing-ip": [
-                  "69.169.224.11"
+                  "69.169.224.7"
                 ]
               }
             },
             "delivery": {
               "timestamp": "date",
-              "processingTimeMillis": 684,
+              "processingTimeMillis": 640,
               "recipients": [
                 "<recipient-email-address>"
               ],
-              "smtpResponse": "250 2.0.0 OK  1669636175 p4-20020a05600c358400b003c6f645db8bsi10597375wmq.192 - gsmtp",
-              "reportingMTA": "b224-11.smtp-out.<region>.amazonses.com"
+              "smtpResponse": "250 2.0.0 OK  1671038958 f20-20020a1c6a14000000b003cdb23b6e5dsi1483316wmc.28 - gsmtp",
+              "reportingMTA": "b224-7.smtp-out.<region>.amazonses.com"
             }
           },
           "Timestamp": "date",