I am trying to call the AWS lambda function from cli by shell script. I want to send the current logged user name to lambda function as parameter. This is the code I tried:
#!/bin/bash
user=$(whoami)
echo "=START="
echo "$user"
aws lambda invoke --invocation-type RequestResponse --function-name shell_lambda_invoke --region ap-south-1 --log-type Tail --payload '{"bashuser":"${user}", "InstanceId":"'i-0c4869ec747845b99'"}'
Thanks in advance.