use the fileb:// ("file binary") syntax for the payload parameter so you don't have to run it through base64

... --payload fileb://invoke-payload.json

Answer from Max Tarpini on Stack Overflow
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ cli โ€บ latest โ€บ reference โ€บ lambda โ€บ invoke.html
invoke โ€” AWS CLI 2.34.36 Command Reference
The following invoke example invokes the my-function function synchronously. The cli-binary-format option is required if youโ€™re using AWS CLI version 2. For more information, see AWS CLI supported global command line options in the AWS Command Line Interface User Guide. aws lambda invoke \ --function-name my-function \ --cli-binary-format raw-in-base64-out \ --payload '{ "name": "Bob" }' \ response.json
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws lambda โ€บ developer guide โ€บ code examples for lambda using aws sdks โ€บ basic examples for lambda using aws sdks โ€บ actions for lambda using aws sdks โ€บ use invoke with an aws sdk or cli
Use Invoke with an AWS SDK or CLI - AWS Lambda
The following invoke example invokes the my-function function asynchronously. The cli-binary-format option is required if you're using AWS CLI version 2. For more information, see AWS CLI supported global command line options in the AWS Command Line Interface User Guide. aws lambda invoke \ ...
Discussions

amazon web services - aws lambda: invoke with payload from cli - Stack Overflow
I'm trying to invoke my lambda using aws cli: $ aws lambda invoke \ --function-name soc-update-dynamodb-java \ --invocation-type Event \ --payload file://invoke-payload.json \ respo... More on stackoverflow.com
๐ŸŒ stackoverflow.com
shell - Invoke lambda function from AWS cli - Stack Overflow
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 ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
amazon web services - AWS CLI execute a lambda function issue - Stack Overflow
I'm trying to invoke a lambda function from my AWS CLI in windows 10. I've done previously a configuration of my client thru AWS configure. The command used is: aws lambda invoke \ --function-n... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Running aws-cli Commands Inside An AWS Lambda Function
219k members in the aws community. News, articles and tools covering Amazon Web Services (AWS), including S3, EC2, SQS, RDS, DynamoDB, IAM โ€ฆ More on reddit.com
๐ŸŒ r/aws
2
7
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws command line interface โ€บ user guide for version 1 โ€บ examples for the aws cli โ€บ aws cli command examples โ€บ lambda examples using aws cli
Lambda examples using AWS CLI - AWS Command Line Interface
The following invoke example invokes the my-function function synchronously. The cli-binary-format option is required if you're using AWS CLI version 2. For more information, see AWS CLI supported global command line options in the AWS Command Line Interface User Guide. aws lambda invoke \ --function-name my-function \ --cli-binary-format raw-in-base64-out \ --payload '{ "name": "Bob" }' \ response.json
๐ŸŒ
Medium
medium.com โ€บ aws-lambda-serverless-developer-guide-with-hands โ€บ invoke-aws-lambda-functions-with-using-aws-cli-commands-2d03622578a9
Invoke AWS Lambda functions with using AWS CLI Commands | by Mehmet Ozkaya | AWS Lambda & Serverless โ€” Developer Guide with Hands-on Labs | Medium
September 12, 2022 - You can see the image on below that shows clients invoking a Lambda function synchronously. ... Lambda sends the events directly to the function and sends the functionโ€™s response back to the invoker. The payload is a string that contains an event in JSON format. The name of the file where the AWS CLI writes the response from the function is response.json.
๐ŸŒ
AWS Fundamentals
awsfundamentals.com โ€บ blog โ€บ mastering-the-aws-lambda-cli
Mastering the AWS Lambda CLI - A Guide for Deployment, ...
By default, our function will be ... passing the invocation type Event. aws lambda invoke \ --function-name myfunction \ --invocation-type Event \ out --log-type Tail { "StatusCode": 202 }...
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ aws-cli-invoke-lambda-functions
Invoke Lambda Functions with AWS CLI - Complete Guide | bobbyhadz
February 26, 2024 - ... Copied!exports.handler = async ... }; To asynchronously invoke a Lambda function with the AWS CLI, set the --invocation-type parameter to Event....
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ aws_lambda โ€บ aws_lambda_executing_and_invoking_lambda_function.htm
Executing and Invoking Lambda Function
This chapter will explain in detail about process of executing and invoking Lambda function and the steps involved in it. AWS execution depends on the configuration details added for AWS Lambda Function.
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws lambda โ€บ developer guide โ€บ understanding lambda function invocation methods โ€บ invoke a lambda function synchronously
Invoke a Lambda function synchronously - AWS Lambda
In the same command prompt, use the base64 utility to decode the logs. The following example shows how to retrieve base64-encoded logs for my-function. aws lambda invoke --function-name my-function out --log-type Tail \ --query 'LogResult' --output text --cli-binary-format raw-in-base64-out | base64 --decode
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ devops โ€บ aws-lambda-functions-with-aws-cli
AWS Lambda Functions With AWS CLI - GeeksforGeeks
July 23, 2025 - To create Lambda function using the CLI, we can use the below command. aws lambda create-function --function-name your-function-name --runtime python3.10 --zip-file fileb://myfiles/my-function.zip --handler lambda_function.handler --role ...
๐ŸŒ
AWS
docs.aws.amazon.com โ€บ aws sdk code examples โ€บ code library โ€บ code examples by service using aws sdks โ€บ code examples for lambda using aws sdks โ€บ basic examples for lambda using aws sdks โ€บ actions for lambda using aws sdks โ€บ use invoke with an aws sdk or cli
Use Invoke with an AWS SDK or CLI - AWS SDK Code Examples
The following invoke example invokes the my-function function synchronously. The cli-binary-format option is required if you're using AWS CLI version 2. For more information, see AWS CLI supported global command line options in the AWS Command Line Interface User Guide. aws lambda invoke \ --function-name my-function \ --cli-binary-format raw-in-base64-out \ --payload '{ "name": "Bob" }' \ response.json
๐ŸŒ
Medium
aws.plainenglish.io โ€บ aws-lambda-invoking-a-function-through-the-console-and-aws-cli-6ceba2120ed7
AWS Lambda: Invoking a Function Through the Console and AWS CLI | by Brandi McCall | AWS in Plain English
January 18, 2023 - aws lambda invoke \ --function-name <function_name> \ --payload <payload_string> \ response.json ยท The payload is a base-64 encoded string. To get your payload string, navigate back to Lambda and copy the event JSON code. Open a web browser and navigate to base64decode.org. Click the โ€œencodeโ€ button at the top.
๐ŸŒ
Medium
rexben.medium.com โ€บ different-ways-to-invoke-aws-lambda-functions-1c95a2dfc8bb
Different ways to invoke AWS Lambda Functions | by Benjamin Ajewole | Medium
September 10, 2023 - In this tutorial, we will be covering how to invoke using the Lambda console, function URL, AWS SDK and the AWS Command Line Interface (AWS CLI).
๐ŸŒ
AWS
docs.aws.amazon.com โ€บ aws serverless application model โ€บ developer guide โ€บ test your serverless application with aws sam โ€บ locally invoke lambda functions with aws sam
Locally invoke Lambda functions with AWS SAM - AWS Serverless Application Model
March 6, 2026 - For example: # Using a JSON file sam local invoke --env-vars env.json # Using a .env file sam local invoke --env-vars .env ยท If your application includes layers, for information about how to debug issues with layers on your local host, see Increase efficiency using Lambda layers with AWS SAM.
๐ŸŒ
Bezdelev
bezdelev.com โ€บ hacking โ€บ aws-cli-inside-lambda-layer-aws-s3-sync
How to use AWS CLI within a Lambda function (aws s3 sync from Lambda) :: Ilya Bezdelev
import subprocess import logging ... is unzipped to the /opt directory, so when you invoke a CLI command from a Lambda function, you need to specify the full path /opt/aws....