Skip to content

IlyaSukhanov/httpie-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPie-Lambda

Invoke AWS Lambda from the command line with all the convenience of HTTPie and without having to utilize API Gateway.

Quick Start

Installation

pip intall httpie-lambda

Usage

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.

How does its work

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.

About

AWS Lambda plugin for httpie

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published