我正在尝试使用以下代码使用AWS PHP SDK向自定义事件总线' custom - event - bus‘发送事件
$client->putEvents([
'Entries' => [ // REQUIRED
[
'Detail' => '{"alpha":"beta"}',
'DetailType' => '',
'EventBusName' => 'custom-event-bus',
'Resources' => ['arn:aws:events:us-east-1:351123639451:event-bus/custom-event-bus',],
'Source' => 'my-application',
'Time' => time(),
],
],
]);我在结果中得到这个错误:
AccessDeniedException (client): User: arn:aws:iam::351123639451:user/my-user is not authorized to perform: events:PutEvents on resource: arn:aws:events:us-east-1:351123639451:event-bus/default - {"__type":"AccessDeniedException","Message":"User: arn:aws:iam::351123639451:user/my-user is not authorized to perform: events:PutEvents on resource: arn:aws:events:us-east-1:351123639451:event-bus/default"}从这个错误消息看,它似乎是在默认事件总线上发送事件,而不是我要发送到的自定义事件总线。
发布于 2020-07-04 15:42:10
此处的syntax是正确的,您可以在EventBusName中指定事件总线名称。
我建议您检查是否没有对此函数名的其他调用,也许将其取出并独立运行。
https://stackoverflow.com/questions/62726070
复制相似问题