I want to create dynamodb table using php-aws-sdk
set_time_limit(0);
error_reporting(E_ALL);
require_once 'aws/aws-autoloader.php';
use Aws\DynamoDb\DynamoDbClient;
$ddb = DynamoDbClient::factory(array(
'key' => $_SERVER['AWS_KEY']),
'secret' => $_SERVER['AWS_SECRET']),
'region' => $_SERVER['AWS_REGION'])
));
$name = 'test';
$ddb->createTable(array(
'TableName' => $name,
'AttributeDefinitions' => array(
array(
'AttributeName' => 'Event ID',
'AttributeType' => 'S'
)
),
'KeySchema' => array(
array(
'AttributeName' => 'Event ID',
'KeyType' => 'HASH'
)
),
'ProvisionedThroughput' => array(
'ReadCapacityUnits' => $_SERVER['DDB_READ_CAPACITY_UNITS']),
'WriteCapacityUnits' => $_SERVER['DDB_WRITE_CAPACITY_UNITS']),
)
));
echo $name;
It is working successfully on local machine, but I have error by running script on Elasticbeanstalk
Fatal error: Uncaught Aws\DynamoDb\Exception\DynamoDbException: AWS Error Code: SerializationException, Status Code: 400, AWS Request ID: HTTCDOVSES4RU0V8IVIQFGREL7VV4KQNSO5AEMVJF66Q9ASUAAJG, AWS Error Type: client, AWS Error Message: class java.lang.String can not be converted to an Long, User-Agent: aws-sdk-php2/2.6.12 Guzzle/3.9.1 curl/7.36.0 PHP/5.5.12 thrown in /var/app/current/aws/Aws/Common/Exception/NamespaceExceptionFactory.php on line 91