cloudposse / terraform-aws-sns-topic

Terraform Module to Provide an Amazon Simple Notification Service (SNS)
https://cloudposse.com/accelerate
47 stars 48 forks source link

aws_sns_topic subscription is getting deleted abruptly #64

Open hariprasath91 opened 1 year ago

hariprasath91 commented 1 year ago

Describe the Bug

When we are trying to delete a identity in amazon , we are deleting the notification relation as well . So when we does it , the sns subscription is also getting deleted.

resource "aws_sns_topic_subscription" "user_updates_email_target" {
topic_arn = aws_sns_topic.test_topic.arn
protocol  = "email"
endpoint  = "example@gmail.com"
}

resource "aws_sesv2_email_identity" "_example_com" {
 identity = "example.com"
}

resource "aws_ses_identity_notification_topic" "_example_com" {
 topic_arn = aws_sns_topic.test_topic.arn
 notification_type = "Bounce"
 identity = aws_sesv2_email_identity._example_com.identity
 include_original_headers = true
}

Expected Behavior

WE dont want the sns topic subscription to be deleted when we delete the sns for the specific domain.

Steps to Reproduce

Delete the resource - resource "aws_ses_identity_notification_topic" "_example_com where the relevant subscription gets deleted.

Screenshots

No response

Environment

Additional Context

No response