0
votes

I have a DynamoDB's Table called "ZombieSession" and the "SessionId" primary key with "S" type.

The local service is running in http://localhost:8181.

For local tests, I'm trying execute these commands:

(1)

aws dynamodb delete-item --table-name ZombieSession --key '4ae40a08-007c-4785-babd-caff0ed12d1d' --endpoint-url http://localhost:8181 --region us-east-1

That results in:

Error parsing parameter '--key': Invalid JSON: '4ae40a08-007c-4785-babd-caff0ed12d1d'

and

(2)

aws dynamodb delete-item --table-name ZombieSession --key '{"SessionId":{"S":"4ae40a08-007c-4785-babd-caff0ed12d1d"}}' --endpoint-url http://localhost:8181 --region us-east-1

That results in:

Error parsing parameter '--key': Invalid JSON: '{SessionId:{S:4ae40a08-007c-4785-babd-caff0ed12d1d}}'

I don't found any documentation example about this.

What's the appropriate command for this operation?

1

1 Answers

10
votes

I discovered that the value of --key parameter need have the quotation mark with escape:

aws dynamodb delete-item --table-name ZombieSession --key "{\"SessionId\":{\"S\":\"4ae40a08-007c-4785-babd-caff0ed12d1d\"}}" --endpoint-url http://localhost:8181 --region us-east-1