What will the policy of aws sqs which is tigger by multiply s3 Bucket

I have S3 bucket and on object-put event I trigger SQS queue and received queue in my instance and process it,

Access policy of sqs is

{
  "Version": "2012-10-17",
  "Id": "arn:aws:sqs:ca-central-1:xxxxxxxxxxxx:abcd",
  "Statement": [
    {
      "Sid": "example-statement-ID",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "SQS:SendMessage",
      "Resource": "arn:aws:sqs:ca-central-1:xxxxxxxxxxxx:abcd",
      "Condition": {
        "ArnLike": {
          "aws:SourceArn": "arn:aws:s3:::<bucket name>"
        }
      }
    }
  ]
}

It's working fine for me but now I want to use the same queue in a two different bucket, I tried policy

{
  "Version": "2012-10-17",
  "Id": "arn:aws:sqs:ca-central-1:xxxxxxxxxxxx:abcd",
  "Statement": [
    {
      "Sid": "example-statement-ID",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "SQS:SendMessage",
      "Resource": "arn:aws:sqs:ca-central-1:xxxxxxxxxxxx:abcd",
      "Condition": {
        "ArnLike": {
          "aws:SourceArn": "arn:aws:s3:::<bucket name>",
          "aws:SourceArn": "arn:aws:s3:::<bucket name2>"
        }
      }
    }
  ]
}

But I didn't work, So anybody please help me to find what will be the Access policy of using same sqs queqe in two different bucket



Read more here: https://stackoverflow.com/questions/68473597/what-will-the-policy-of-aws-sqs-which-is-tigger-by-multiply-s3-bucket

Content Attribution

This content was originally published by vinay gautam at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: