SNS通知目标规则“无法访问"尝试从代码管道发送通知时 [英] SNS notification target rule is "unreachable" when tryin to send a notification from code pipeline

查看:22
本文介绍了SNS通知目标规则“无法访问"尝试从代码管道发送通知时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用支持 SNS 的通知规则为代码管道设置通知.

I am trying to set up a notification for the code pipeline using its notification rule which supporters SNS.

如图所示,状态为无法访问"

As you can see in the picture the status is "unreachable"

如果我查看这里的链接 aws 故障排除

If I look at the link here aws troubleshoot

我已经完成了所有步骤,甚至是在 SNS 主题的访问策略中添加 codestar-notifications 的步骤.

I have followed all the step even the step of adding of codestar-notifications in Acces policy of SNS topic.

{
      "Sid": "AWSCodeStarNotifications_publish",
      "Effect": "Allow",
      "Principal": {
        "Service": "codestar-notifications.amazonaws.com"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:codestar-notifications:us-east-1:272075499248:notificationrule/50d629524d433dceeafdb6c5fe136e404f29e9e5"
    }

但是,状态保持不变,也尝试过手动启动管道但仍然无法工作.

But still, the status remains the same also tried with manually starting the pipeline but still not working.

我错过了什么吗?有人能帮我解决这个问题吗?

Am I missing something? could anyone help me out of this?

 {
  "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",
        "SNS:Receive"
      ],
      "Resource": "arn:aws:sns:us-east-1:272075499248:develop",
      "Condition": {
        "StringEquals": {
          "AWS:SourceOwner": "272075499248"
        }
      }
    },
    {
      "Sid": "AWSCodeStarNotifications_publish",
      "Effect": "Allow",
      "Principal": {
        "Service": "codestar-notifications.amazonaws.com"
      },
      "Action": "SNS:Publish",
      "Resource": "arn:aws:sns:us-east-1:272075499248:develop"
    }
  ]
}

推荐答案

解决此问题的一种方法是使用 CodePipeline 用户界面创建主题.这将为您设置所有必需的权限.创建通知规则时,在目标"下,选择创建目标".并输入您要创建的主题的名称.将使用已设置的权限创建主题.您只需要订阅该主题即可接收通知.

One way to solve this is to use the CodePipeline user interface to create the Topic. This will set all of the required permissions for you. When creating the Notification Rule, under "Targets", select "Create Target" and enter the name of the Topic you wish to create. The topic will be created with permissions already set. You will just need to subscribe to the topic to receive the notifications.

这篇关于SNS通知目标规则“无法访问"尝试从代码管道发送通知时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆