Solve - Error parsing Parameter expected = Received EOF

avatar

Borislav Hadzhiev

Wed Sep 15 20212 min read

banner

Photo by Aaron Burden

Error parsing Parameter expected = Received EOF for input #

The "Error parsing Parameter expected = Received EOF for input" error occurs when an local file is passed as a parameter to an AWS CLI command, without setting the file:// prefix.

error parsing parameter

To solve the "Error parsing Parameter expected = Received EOF for input" error prefix the parameter that takes the local file with file://:

shell
aws dynamodb put-item --table-name TestTable --item file://item.json
When you have to pass a file on your local file system as a --parameter to an AWS CLI command, prefix the filepath with file://.

In the example above, the shell is opened in the directory where the item.json file is located. If your terminal is opened in a different directory you can pass a local or absolute path leading to the file.

For example on linux and macOS you can use relative and absolute paths as follows:

shell
# relative path, same directory aws dynamodb put-item --table-name TestTable --item file://item.json # relative path, navigate to directory aws dynamodb put-item --table-name TestTable --item file://./item.json # absolute path aws dynamodb put-item --table-name TestTable --item file:///home/john/item.json

Note that for absolute paths on linux and macOS we have 3 / (forward slash) symbols, the first 2 being a part of the prefix and the third a part of the absolute path.

On windows you can specify a file:// prefix as follows:

shell
aws dynamodb put-item --table-name TestTable --item file://C:\my-folder\item.json

In some very rare cases you might have to prefix the file parameter with fileb://, instead of file://. The fileb:// prefix reads your file as binary.

Use the file:// prefix when passing human-readable files as --parameters and use the fileb:// prefix when passing binary files (not human-readable) as --parameters to an AWS CLI command.

Further Reading #

Add me on LinkedIn

I'm a Web Developer with TypeScript, React.js, Node.js and AWS experience.

Let's connect on LinkedIn

Join my newsletter

I'll send you 1 email a week with links to all of the articles I've written that week

Buy Me A Coffee