Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

680
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda