Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

What am I doing wrong here, please help me :)

aws dynamodb put-item --table-name PhoneBook --item '{"PhoneNo":{"S","12345"},"Name":{"S","abc"}}' --return-consumed-capacity TOTAL

Error parsing parameter '--item': Expected: '=', received: ''' for input:

'{PhoneNo:{S,12345},Name:{S,abc}}'

^

 

1 Answer

0 votes
by (44.4k points)

If you don’t escape the double quotes in your statement then you will get the same error. Try the below line in AWS CLI and it should work.

aws dynamodb put-item --table-name PhoneBook --item "{""PhoneNo"":{""S"",""12345""},""Name"":{""S"",""abc""}}" --return-consumed-capacity TOTAL

This would be the output:

{

    "ConsumedCapacity": {

        "TableName": "PhoneBook",

        "CapacityUnits": 1.0

    }

}

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...