Invoke AWS Lambda from the command line with all the convenience of HTTPie and without having to utilize API Gateway.
pip intall httpie-lambda
Usage is consistent with HTTPie, simply use http+lambda as protocol and the name of the lambda as host portion of the URL.
To call health endpoint of the Lambda function named flaskexp-test:
> http http+lambda://flaskexp-test/health
HTTP/1.1 200 OK
Content-Length: 21
Content-Type: application/json
X-Request-ID:
{
"status": "UP"
}
For more comprehensive example such as POST refer to HTTPie usage documentation.
Specify a region or AWS credentials profile:
> env AWS_DEFAULT_REGION=us-west-2 AWS_PROFILE=sukhanov http http+lambda://flaskexp-test/health
HTTP/1.1 200 OK
Content-Length: 21
Content-Type: application/json
X-Request-ID:
{
"status": "UP"
}
For more information on AWS Authentication configuration see lambda-requests.
Lambda is invoked with payload that emulates AWS API Gateway simple proxy format. This enables calling of lambda as an HTTP service without having to utilize AWS API Gateway itself.