I am working on a Cloud Computing class project using AWS Command Line Interface to insert a table in DynamoDB. The step I'm stuck on is adding the other non-key attributes to the table. I read through the Help section about adding the attributes and came up with the following:
aws dynamodb put-item \
--table-name Sensors \
--item '{"SensorDescription": {"S": "A"}, \
"ImageFile": {"S": "file1"}, \
"SampleRate": {"N": "100"}, \
"Locations": {"L": "Aberdeen MD, Warren MI, Orlando FL"} \
--return-consumed-capacity TOTAL
I've tried batch-write-item and re-formatting examples I found through AWS Help but I am still having issues. I've been using Cloud9 for a while but DynamoDB is very new to me. Any help is greatly appreciated. The table Sensors is already created and has the following info:
vocstartsoft:~/environment $ aws dynamodb describe-table --table-name Sensors
{
"Table": {
"AttributeDefinitions": [
{
"AttributeName": "Sensor",
"AttributeType": "S"
}
],
"TableName": "Sensors",
"KeySchema": [
{
"AttributeName": "Sensor",
"KeyType": "HASH"
}
],
"TableStatus": "ACTIVE",
"CreationDateTime": 1607909069.531,
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"TableSizeBytes": 0,
"ItemCount": 0,
"TableArn": "arn:aws:dynamodb:us-east-1:466773264882:table/Sensors",
"TableId": "5ddc11bc-8167-4bfa-bbcc-96199954ba39"
}
}
--itemparameter. I think the error will likely be some kind of unexpected end of json.