Open cjhelloletsgo opened 3 days ago
This doesn't happen if you deploy in one go. I think it is caused by adding the target after the notification rule is already created.
Hey @cjhelloletsgo , thanks for reaching out. Could you please check the Topics access policy statement because as per AWS Docs , it should look like the following -
{
"Version": "2008-10-17",
"Id": "__default_policy_ID",
"Statement": [
{
"Sid": "__default_statement_ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
"SNS:GetTopicAttributes",
"SNS:SetTopicAttributes",
"SNS:AddPermission",
"SNS:RemovePermission",
"SNS:DeleteTopic",
"SNS:Subscribe",
"SNS:ListSubscriptionsByTopic",
"SNS:Publish"
],
"Resource": "arn:aws:sns:us-east-2:123456789012:codestar-notifications-MyTopicForNotificationRules",
"Condition": {
"StringEquals": {
"AWS:SourceOwner": "123456789012"
}
}
},
{
"Sid": "AWSCodeStarNotifications_publish",
"Effect": "Allow",
"Principal": {
"Service": [
"codestar-notifications.amazonaws.com"
]
},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:us-east-2:123456789012:codestar-notifications-MyTopicForNotificationRules"
}
]
}
Request you to share the same.
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Describe the bug
The aws_cdk.aws_codestarnotifications NotificationRule and CfnNotificationRule constucts both create notification rules which are unable to reach a sns target.
The correct policy is added to the sns topic according to the docs but the topic is always unreachable. https://docs.aws.amazon.com/dtconsole/latest/userguide/notification-target-create.html?icmpid=docs_acn_console_acp
Creating a sns topic target through the console works fine and if i describe a notification rule with a target created by the cdk it looks identical to the ui created target.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The sns topic should have an Active Notification target status.
Current Behavior
The target SNS topic is in an Unreachable Notification target status.
Reproduction Steps
Code example:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.162.1 (build 10aa526)
Framework Version
No response
Node.js Version
v20.18.0
OS
Ubuntu 24.04
Language
Python
Language Version
Python 3.12.3
Other information
No response