php - S3 Notifications to SQS: "Unable to validate the following destination configurations" -
i trying create s3 bucket notification sqs.
$downarn = $client->getqueuearn($downurl); $client->addpermission([ 'queueurl' => $downurl, 'label' => 's3watcher', 'awsaccountids' => [ 'aws' => '*' // throw error; setting plain * not work ], 'actions' => ['*'] ]); $s3->putbucketnotificationconfiguration([ 'bucket' => 's3-to-sqs-test', 'queueconfigurations' => [ [ 'id' => 'files upload watcher', 'queuearn' => $downarn, 'events' => [ 's3:objectcreated:put', ], ], ] ]);
problem without permission can't create notification, receive error
unable validate following destination configurations
when manually going sqs , adding permission, there can mark everybody (*)
users, can't make same php side.
tl;dr how add sqs permission every principal (awsaccountids) using php aws sdk
it's aws sdk limitation in sdk v2. can bypass setting attributes > policy
json string when creating sqs.
$client ->createqueue([ 'queuename' => $name, 'attributes' => [ 'policy' => json_encode([ 'version' => '2012-10-17', 'id' => $id, 'statement' => [ [ 'sid' => 'sid1', 'effect' => 'allow', 'principal' => '*', 'action' => 'sqs:*', 'resource' => 'arn:aws:sqs:*:*:*', ] ], ]), ] ])
resource
has format arn:aws:{service}:{region}:{accountid}:{resourcename}
putted *
apply region account , resource.
id
, sid
seems allow text.
version
must 2012-10-17
Comments
Post a Comment