I am trying to connect to DynamoDB using AWS SDK Version 3. In my di.php file I have written code
$di->set( "dynamodb",
function () use ($config) {
return new \Aws\DynamoDb\DynamoDbClient(array(
'version' => '2012-08-10',
'region' => $config->dynamodb->region,
'credentials' => array(
'key' => $config->dynamodb->key,
'secret' => $config->dynamodb->secret,
),
));
} );
In my controller when i do this: $ds = $this->getDi()->get('dynamodb');
Its showing error: { "error": 0, "error_description": "The dynamodb service does not have version: 22." }
It would be very helpfull if someone please point out what is missing in my code.
Thanks