Skip to main content

AWS Lambda invoke transport plugin for HTTPie

Project description

https://img.shields.io/pypi/v/httpie_lambda.svg

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpie-lambda-1.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

httpie_lambda-1.0-py2.py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page