Amazon comprehend PII detection job: Error parsing parameter 'cli-input-json': Invalid JSON received.


I am trying to run a pii detection job using the command

aws comprehend start-pii-entities-detection-job \
    --region us-east-1 \
    --job-name pii_test\
    --cli-input-json input.json

But I get the error

Error parsing parameter 'cli-input-json': Invalid JSON received.

My json is formatted correctly as far as I can tell. Has anyone seen this before or know a fix? Thanks

  • Can you share your JSON? Does it parse correctly through a tool such as jq?

asked 2 years ago240 views
1 Answer

The --cli-input-json option takes the actual JSON document as its value, not a filename. You need to use file://input.json, which will make the CLI read the value from the file.

(Had a brainwave a while after posting my initial comment above!)

profile pictureAWS
answered 2 years ago
  • Thanks that worked!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions