Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

AWS CLI dollar sign '$' escaping when invoking lambda function

there! I got little problem invoking aws lambda function from cli on Windows, my invocation code looks like this

aws lambda invoke --function-name blah-blah-event-generator --cli-binary-format raw-in-base64-out --payload '{\"UserName\": \"blah-blah\", \"Pwd\": \"blah$$blah\", \"Operation\": \"blah\"}' response.json

And this error occurs

An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Could not parse payload into json: Unrecognized character escape '$' (code 36)

To overcome this problem I tried to add ” symbol before dollar signs but nothing changes:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

aws lambda invoke --function-name blah-blah-event-generator --cli-binary-format raw-in-base64-out --payload '{\"UserName\": \"blah-blah\", \"Pwd\": \"blah\$\$blah\", \"Operation\": \"blah\"}' response.json

>Solution :

On Windows you need to use double quotation mark (") for the payload parameter. The $ is not generating any problem.

Try with this command (I have taken the first command and changed ‘ by "):

aws lambda invoke --function-name blah-blah-event-generator --cli-binary-format raw-in-base64-out --payload "{\"UserName\": \"blah-blah\", \"Pwd\": \"blah$$blah\", \"Operation\": \"blah\"}" response.json
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading