Why does the notifications still be pushed after the SNS topic had been deleted?

0

Hi All, My application use SNS to send the error message base on email subscription.

For now the application had been stop, but the error message still push to my email...

And I already unsubscripte, even delete the SNS topic, but nothing help... the notification emails are still sented to me.....crazy..

The image belowed come from CloudTrail Event history: Enter image description here

Does anyone know what happend ?

Update:

Enter image description here

Enter image description here

CloudTrail Data Log:

{
    "Records": [
        {
            "eventVersion": "1.09",
            "userIdentity": {
                "type": "AWSService",
                "invokedBy": "cloudwatch.amazonaws.com"
            },
            "eventTime": "2024-03-30T03:52:14Z",
            "eventSource": "sns.amazonaws.com",
            "eventName": "Publish",
            "awsRegion": "us-west-2",
            "sourceIPAddress": "cloudwatch.amazonaws.com",
            "userAgent": "cloudwatch.amazonaws.com",
            "errorCode": "NotFoundException",
            "errorMessage": "Topic does not exist",
            "requestParameters": {
                "topicArn": "arn:aws:sns:us-west-2:{my aws account id}:systemErrorNotify",
                "message": "HIDDEN_DUE_TO_SECURITY_REASONS",
                "subject": "HIDDEN_DUE_TO_SECURITY_REASONS",
                "messageStructure": "json"
            },
            "responseElements": null,
            "requestID": "00730c8f-782d-5286-ac57-520ef6837e2a",
            "eventID": "5514c463-dfe0-44a9-93dc-fd4562939112",
            "readOnly": false,
            "resources": [
                {
                    "accountId": "{my aws account id}",
                    "type": "AWS::SNS::Topic",
                    "ARN": "arn:aws:sns:us-west-2:{my aws account id}:systemErrorNotify"
                }
            ],
            "eventType": "AwsApiCall",
            "managementEvent": false,
            "recipientAccountId": "{my aws account id}",
            "sharedEventID": "13e9f7df-c295-4615-9caa-d26300726129",
            "eventCategory": "Data"
        }
    ]
}

This log mean:

For test reason that my application want to call the sns api for send the message after i had deleted the SNS topic, this log is expected. But this deleted SNS topic is still sending the notifications to my email........e...

kazaff
asked a month ago170 views
3 Answers
0

Hello.

Is it possible that the SNS topic has not been deleted completely?
For example, is it possible that you are deleting the wrong SNS topic or viewing the wrong region?
I thought that if the SNS topic was deleted, I would not be able to send messages.
https://docs.aws.amazon.com/sns/latest/dg/sns-delete-subscription-topic.html

If a subscriber attempts to publish a message to the deleted topic, the publisher will receive an error message indicating that the topic doesn't exist. Similarly, any attempt to subscribe to the deleted topic will also result in an error message.

You might be able to see something by enabling a trail in CloudTrail and logging data events.
https://docs.aws.amazon.com/sns/latest/dg/sns-logging-using-cloudtrail.html

profile picture
EXPERT
answered a month ago
  • Hi, I'm sure i have deleted the right SNS topic, But right now I still recieve the message from that SNS....ghost?!..

  • From the AWS Web console, SNS List page is empty.. FYI: the application was terminated.....

  • I have checked the Event history from CloudTrail, and I found that record what indicate the target topic have been deleted. 🤔

  • Have you checked another region? Also, is it possible to share messages sent from SNS topics?

  • I'm checked the target region. And I found a new infomation: I checked the email original data from gmail, and the "Received" header show below:

    by 2002:a54:390d:0:b0:24d:f817:281e with SMTP id r13csp2018534ecs;
            Fri, 29 Mar 2024 20:01:46 -0700 (PDT)
    

    Does it indicate the message was posted to email server in that time?

0

Could AWS Config be involved somewhere? So when you delete the SNS Topic, its absence is recognised by AWS Config, and a remediation action is triggered which causes the topic to be recreated?

Or something could be recreating the topic from outside AWS, e.g. Terraform ?

Verify the topic really is deleted with aws sns list-topics and also check other regions https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sns/list-topics.html

profile picture
EXPERT
Steve_M
answered a month ago
profile picture
EXPERT
reviewed a month ago
  • Thank in adivance. There is no other mechanism to reconstruct topic(I'm sure).

  • I have use aws sns list-topics command to check the topic, everything is expected.

0

I wandor that the SNS is based on message queue ?

Otherwise you can't explain the phenomenon....

kazaff
answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions