File tree Expand file tree Collapse file tree 1 file changed +2
-29
lines changed
php/example_code/dynamodb Expand file tree Collapse file tree 1 file changed +2
-29
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments