Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

675
Views
AWS CLI: Error parsing parameter '--item': Expected: '=', received: '"' for input:

I am trying to simply insert one item using json as input file. I am running command on Windows Cmd prompt:

aws2 dynamodb put-item --table-name testCLI --item file://C:\Temp\DynamoDB\item.json

table testCLI has 2 attributes - ID and Value

File item.json:

"{\"ID\": {\"N\":\"2\"}, \"Value\": {\"S\": \"From json file with escape characters\"}}"

I am getting error:

Error parsing parameter '--item': Expected: '=', received: '"' for input: "{\"ID\": {\"N\":\"2\"}, \"Value\": {\"S\": \"From json file with escape characters\"}}"

aws2 --version

aws-cli/2.0.0dev3 Python/3.7.5 Windows/10 botocore/2.0.0dev2
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

If you are using Windows, you can use escape sequence as in the following command to successfully run in AWS CLI as below:

aws textract detect-document-text --document "{\"S3Object\":{\"Bucket\":\"NameOfBucket\",\"Name\":\"NameOfImage\"}}"
over 4 years ago · Santiago Trujillo Report

0

That error is being caused by the quotes at the beginning and end of the JSON file.

However, removing them also seems to cause a problem due to the backslashes.

It worked for me (on a Mac, not Windows) when I used this file:

{"ID": {"N":"2"}, "Value": {"S": "From json file with escape characters"}}
over 4 years ago · Santiago Trujillo Report

0

Was trying out AWS DynamoDB samples from Windows CMD prompt... I spent more time figuring out the command, escape characters, quotes, .... than the time i spent on learnign DynamoDB itself. Phew!

Just adding the below if it might help anyone, and myself if i end up googling/sfo'ing again!!

Command for Linux Shell

aws dynamodb put-item \
--table-name device_data \
--item \
'{"device_id": {"S": "12345678"}, "datacount": {"N": "1"} , "timestamp": {"N": "1514876999940"}, "temperature1": {"N": "32.78"}, "temperature2": {"N": "21.76"}, "temperature3": {"N": "15.12"}, "temperature4": {"N": "20.22"}, "temperature5": {"N": "14.43"} }'

Command that worked for me in Windows Command Prompt

aws dynamodb put-item ^
--table-name device_data ^
--item ^
"{\"device_id\": {\"S\": \"12345678\"}, \"datacount\": {\"N\": \"1\"} , \"timestamp\": {\"N\": \"1514876999940\"}, \"temperature1\": {\"N\": \"32.78\"}, \"temperature2\": {\"N\": \"21.76\"}, \"temperature3\": {\"N\": \"15.12\"}, \"temperature4\": {\"N\": \"20.22\"}, \"temperature5\": {\"N\": \"14.43\"} }"
  1. Replaced Back Slash \ with Carot ^ --> this is only for breaking the command to next line. No space after Carot ^
  2. Replaced Single qoute ' with Double Quote " around the whole JSON
  3. Added Back Slash \ as Escape Char before the Double Quote " inside JSON
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!