Skip to main content

No project description provided

Project description

License Code Style

AWS ALB Response Creator

The AWS announcement of Application Load Balancers supporting Lambda functions made my reInvent experience!


In doing a PoC however, I found that the statusDescription element was somewhat of an annoyance to code. This package provides a method to return the appropriate format of this field without copy/paste response data and allowing a strategy to implement this to swap out response formats for API Gateway or ALB as needed.


Run pip install alb-response


from alb_response import alb_response

def lambda_handler(event, context):

    response_dict = process_the_event(event)

    return alb_response(


  1. Setup an Application Load Balancer (ALB)
  2. Create a target group for the Lambda
  3. Assign appropriate permissions to your Lambda function
  4. Attach the target group to the ALB with a rule


Contributions are welcome! Please open an issue or make a pull request.

If making a pull request, please run the tests and ensure that you maintain or increase code coverage.


To make this project more portable and keep environments organized, this project leverages pipenv. To install deterministic dependencies, run pipenv sync.

Run Tests

To run the tests, install the dependencies and run behave.

To get code coverage as well, run coverage run --source='.' -m behave followed by coverage report.

Release Log

  • 0.1.0
    • Initial Release
  • 0.1.1
  • 0.1.2
    • Patch to support null json responses without sending an empty json object

Project details

Download files

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

Files for alb-response, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size alb_response-0.1.2-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size alb-response-0.1.2.tar.gz (2.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page