I'm providing cross-account services to my client, who has their own AWS account. I'd like them to be able to configure any S3 bucket that they own so that any ObjectCreated
event is logged to my SQS queue. I'd also like to prevent any other party from writing to my queue, or configuring their buckets to write object notifications to my queue.
So far, I have this permission document. (My accountId: 222222222222
, my customer's accountId: 111111111111
)
{
"Sid": "CrossAccountWrite",
"Effect": "Allow",
"Principal": {
"Service": "s3.amazonaws.com"
},
"Action": "SQS:SendMessage",
"Resource": "arn:aws:sqs:us-west-2:222222222222:customer-s3-notifications",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:*:*:customer-s3-bucket"
}
}
}
This allows one of their buckets to write to my queue; however, I'd like to allow any of their buckets to write to my queue. Normally, I'd just wildcard on an ARN that starts with their customer accountId; however, for whatever reason, S3 buckets don't have a region and don't have an accountId in them. Is there any way for me to do this filtering at the permission level?