【发布时间】:2017-06-12 17:22:20
【问题描述】:
我正在尝试使用 SQS 创建 S3 存储桶通知。
$downArn = $client->getQueueArn($downUrl);
$client->addPermission([
'QueueUrl' => $downUrl,
'Label' => 'S3Watcher',
'AWSAccountIds' => [
'AWS' => '*' // This will throw error; Setting to plain * does not work too
],
'Actions' => ['*']
]);
$s3->putBucketNotificationConfiguration([
'Bucket' => 's3-to-sqs-test',
'QueueConfigurations' => [
[
'Id' => 'Files upload watcher',
'QueueArn' => $downArn,
'Events' => [
's3:ObjectCreated:Put',
],
],
]
]);
问题是未经许可我无法创建通知,我收到错误
无法验证以下目标配置
当手动进入 SQS 并添加权限时,我可以为所有用户标记Everybody (*),但我不能从 PHP 端做同样的事情。
TL;DR如何使用 PHP AWS SDK 为每个 Principal (AWSAccountIds) 添加 SQS 权限
【问题讨论】: