AWS DynamoDB和PhP - 禁止错误

问题描述 投票:1回答:1

我正在使用Amazon Elastic beanstalk并运行php服务器。简单的应用程序运行正常但是每当我尝试连接到AWS DynamoDB时,它都会给我错误

被禁止

您无权访问此服务器上的/。

下面是代码

<?php
require 'aws/aws-autoloader.php';
require 'config.php';
date_default_timezone_set('America/New_York');

use Aws\DynamoDb\DynamoDbClient;

$client = DynamoDbClient::factory($config);

$result = $client->describeTable(array(
    'TableName' => 'abcmsg'
));

echo 'Result is ', $result;

?>

不确定我是否需要设置一些IAM角色,但是这些是什么以及在哪里需要?

php amazon-web-services amazon-dynamodb
1个回答
0
投票

您需要配置IAM实例配置文件

请遵循以下步骤:

enter image description here

然后选择您偏好的角色:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.