Last updated: Feb 26, 2024
Reading time·2 min
The "Error parsing Parameter expected = Received EOF for input" error occurs
when a local file is passed as a parameter to an AWS CLI command, without
setting the file://
prefix.
To solve the error prefix the parameter that takes the local file with
file://
.
aws dynamodb put-item --table-name TestTable --item file://item.json
--parameter
to an AWS CLI command, prefix the file path 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:
# 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 are a part of the prefix and the third is a part of the
absolute path.
On Windows, you can specify a file://
prefix as follows:
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.
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.You can learn more about the related topics by checking out the following tutorials: