LoginSignup
1
0

More than 1 year has passed since last update.

S3 の Event notifications でエラー

Last updated at Posted at 2022-05-07

S3 にオブジェクトが作成された時に、メールを受信したいのですが、エラーとなってしまいます。

"Unable to validate the following destination configurations"

と出力され、その上には、なんだか、権限が足りない、という記述があります。
これを解決するには、SNS トピックのアクセスポリシーを変更する必要があるようでした。

SNS トピックのアクセスポリシーを以下のように変更したところ、エラーがなくなりました。

{
  "Version": "2008-10-17",
  "Id": "__default_policy_ID",
  "Statement": [
    {
      "Sid": "__default_statement_ID",
      "Effect": "Allow",
      "Principal": {
        "Service": "s3.amazonaws.com"
      },
      "Action": [
        "SNS:GetTopicAttributes",
        "SNS:SetTopicAttributes",
        "SNS:AddPermission",
        "SNS:RemovePermission",
        "SNS:DeleteTopic",
        "SNS:Subscribe",
        "SNS:ListSubscriptionsByTopic",
        "SNS:Publish"
      ],
      "Resource": "arn:aws:sns:<REGION>:<ACCOUNT_ID>:<SNS_TOPIC_NAME>",
      "Condition": {
        "ArnLike": {
          "aws:SourceArn": "arn:aws:s3:*:*:<BUCKET_NAME>"
        }
      }
    }
  ]
}

(参考)
https://stackoverflow.com/questions/38088816/how-to-setup-permissions-for-s3-event-to-sns-topic

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0