I am trying to listen to events when sending emails via SES
in localstack
. I have created corresponding queues
and SNS
topics.
I define a configuration set for when sending email:
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
I define the 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","delibery","open","click"],"SNSDestination":{"TopicARN":"arn:aws:sns:eu-central-1:000000000000:ses_events_topic"}}' --profile test-profile --region eu-central-1 --output table | cat
I've also tried to define the event destination
via file:
aws --endpoint-url=http://localhost:4566 ses create-configuration-set-event-destination --configuration-set-name ses_config_set --event-destination file://set_event_destination_attrs.json --profile test-profile --region eu-central-1 --output table | cat
// set_event_destination_attrs.json
{
"Name": "string some",
"Enabled": true,
"MatchingEventTypes": ["send","reject","bounce","complaint","delivery","open","click","renderingFailure"],
"SNSDestination": {
"TopicARN": "arn:aws:sns:eu-central-1:000000000000:ses_events_topic"
}
}
Both ses create-configuration-set-event-destination
commands seem to work, no error is given in the console.
But when sending an email using this config set
:
aws --endpoint-url=http://localhost:4566 ses send-email --destination '{"ToAddresses":["receiver@mail.com"]}' --message '{"Subject":{"Data":"foo subject","Charset":"string"},"Body":{"Text":{"Data":"foo body","Charset":"string"}}}' --configuration-set-name ses_config_set --from 'sender@test.com' --profile test-profile --region eu-central-1 --output table | cat
I can't see any event in my queue. Theoretically, SES
should send an event
to the SNS
topic (like bounce, click etc.), and the queue is subscribed to the SNS
. Publishing a message from the SNS
topic to the queue works fine.
I have the suspicion that the
create-configuration-set-event-destination
might be wrong. Maybe the--event-destination
json, the format, etc.How can I debug that the
event destination
is properly set?
Thanks in advance