-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.php
More file actions
43 lines (40 loc) · 960 Bytes
/
sample.php
File metadata and controls
43 lines (40 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
require './lib/php/aws/aws-autoloader.php';
use \Aws\DynamoDb\DynamoDbClient;
$client = \Aws\DynamoDb\DynamoDbClient::factory(array(
'credentials' => [
'key' => 'cs452',
'secret' => 'cs452',
],
'version' => '2012-08-10',
'region' => 'us-west-2',
'endpoint' => 'http://localhost:8000'
));
$result = $client->createTable([
'AttributeDefinitions' => [
[
'AttributeName' => 'filename',
'AttributeType' => 'S',
],
[
'AttributeName' => 'user_id',
'AttributeType' => 'S',
],
],
'KeySchema' => [
[
'AttributeName' => 'filename',
'KeyType' => 'HASH',
],
[
'AttributeName' => 'user_id',
'KeyType' => 'RANGE',
],
],
'ProvisionedThroughput' => [
'ReadCapacityUnits' => 5,
'WriteCapacityUnits' => 5,
],
'TableName' => 'Image',
]);
echo $result;