If you want to invoke an AWS Lambda from your CLI, then the best option is to have the AWS CLI installed.
Once this is installed, you can invoke Lambdas as follows:
Setting your AWS Region
It is recommended to always set your AWS region in an environment variable called
Option 1 – Recommended with AWS CLI v2
Option 2 – If you need to use AWS CLI v1
We specified a
response.json at the end of the above commands. This is to get the output from the Lambda run.
You can also see detailed logs directly in the CloudWatch group associated to the above Lambda function.