Complete the code to specify the read capacity units for a DynamoDB table.
ProvisionedThroughput={"ReadCapacityUnits": [1], "WriteCapacityUnits": 5}The ReadCapacityUnits must be a positive integer representing the number of strongly consistent reads per second.
Complete the code to calculate the total cost for 1000 read requests with a cost of $0.00013 per read unit.
total_cost = 1000 * [1]
The cost per read unit is $0.00013, so multiply by the number of requests to get total cost.
Fix the error in the code to correctly estimate the write capacity units needed for 500 writes per second with each write consuming 2 WCUs.
required_wcu = 500 [1] 2
Each write consumes 2 WCUs, so multiply the number of writes by 2 to get total WCUs needed.
Fill both blanks to create a DynamoDB query that filters items with attribute 'status' equal to 'active' and limits results to 10.
response = table.query(KeyConditionExpression=[1], Limit=[2])
The KeyConditionExpression must check for 'status' equal to 'active'. The Limit should be set to 10 to restrict results.
Fill all three blanks to create a DynamoDB update expression that sets 'score' to 100 only if the current 'score' is less than 100.
response = table.update_item(Key=[1], UpdateExpression=[2], ConditionExpression=[3])
The Key must identify the item by its primary key. The UpdateExpression sets the 'score' attribute. The ConditionExpression ensures the update only happens if the current score is less than 100.