Skip to content

Commit 03e13cd

Browse files
committed
updated PHP example to use BillingMode
1 parent d5506b0 commit 03e13cd

File tree

1 file changed

+2
-29
lines changed

1 file changed

+2
-29
lines changed

php/example_code/dynamodb/Tables_CRUD.php

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -57,36 +57,9 @@
5757
####################################################################
5858
# Updating the table
5959

60-
echo "# Updating the provisioned throughput of table $tableName.\n";
61-
try {
62-
$response = $dynamodb->updateTable([
63-
'TableName' => $tableName,
64-
'ProvisionedThroughput' => [
65-
'ReadCapacityUnits' => 6,
66-
'WriteCapacityUnits' => 7
67-
]
68-
]);
69-
70-
$dynamodb->waitUntil('TableExists', [
71-
'TableName' => $tableName,
72-
'@waiter' => [
73-
'delay' => 5,
74-
'maxAttempts' => 20
75-
]
76-
]);
60+
// No need to update provisioned throughput as we are using PAY_PER_REQUEST mode.
7761

78-
echo "New provisioned throughput settings:\n";
79-
80-
$response = $dynamodb->describeTable(['TableName' => $tableName]);
81-
82-
echo "Read capacity units: " .
83-
$response['Table']['ProvisionedThroughput']['ReadCapacityUnits'] . "\n";
84-
echo "Write capacity units: " .
85-
$response['Table']['ProvisionedThroughput']['WriteCapacityUnits'] . "\n";
86-
} catch (DynamoDbException $e) {
87-
echo $e->getMessage() . "\n";
88-
exit("Unable to update table $tableName\n");
89-
}
62+
echo "# Skipping table update for throughput settings (not needed for PAY_PER_REQUEST).\n";
9063

9164
####################################################################
9265
# Deleting the table

0 commit comments

Comments
 (0)