Facing issue related to adding custom JSON input in aws event target as we know aws didnt allow to add event pattern with scheduled expression in event rule so we have to add custom Input in target event so in that case i was using github-action to update rule target with custom Input but didnt able to update Input Json job runs fine and didnt throw any error of syntax mismatch adding code and pic for ref here.
in github-action shell job
1- rule command
aws events put-rule --name "$JOB_NAME" --schedule-expression "$JOB_SCHEDULE"
2- target command that needs to pass custom input to lambda target
aws events put-targets --rule "$JOB_NAME" --targets "Id"="1","Arn"="$LAMBDA_ARN","Input"=`{"jobName":"event_lambda_trigger"}`
another command with a different input format
aws events put-targets --rule "$JOB_NAME" --targets "Id"="$JOB_NAME","Arn"="$LAMBDA_ARN","Input"={\"jobName\":\"$JOB_NAME\"}
I tried these commands and it make rule and target but didnt update target custom JSON input I want to make target send custom JSON Input to lambda trigger. used this method also link
{\"jobName\":\"$JOB_NAME\"}
--targets
flag. Your use case is a bit different. Given your use case, it seems like a quotes' escaping issue. You can use shellcheck.net to fix that. Smething likeaws events put-targets --rule "$JOB_NAME" --targets "\"Id\"=\"$JOB_NAME\",\"Arn\"=\"$LAMBDA_ARN\",\"Input\"=\"{\"jobName\":\"$JOB_NAME\"}\""
may work but I'm not sure. You need to test this on your side. Specifying this value as JSON as mentioned in that issue seems like a better option.