Skip to main content

AWS CDK package that creates a highly opinionated application load balancer.

Project description

AWS ALB (Application Load Balancer)

An abstract application loadbalancer construct. It creates a loadbalancer and default security groups and listeners for the loadbalancer. Also, this loadbalancer is ready for blue-green deployments.


The project is written by Laimonas Sutkus and is owned by iDenfy. This is an open source library intended to be used by anyone. iDenfy aims to share its knowledge and educate market for better and more secure IT infrastructure.

Related technology

This project utilizes the following technology:

  • AWS (Amazon Web Services).
  • AWS CDK (Amazon Web Services Cloud Development Kit).
  • AWS CloudFormation.
  • AWS Loadbalancer.
  • AWS Security groups.


This library project assumes the following:

  • You have knowledge in AWS (Amazon Web Services).
  • You have knowledge in AWS CloudFormation and AWS loadbalancing.
  • You are managing your infrastructure with AWS CDK.
  • You are writing AWS CDK templates with a python language.


The project is built and uploaded to PyPi. Install it by using pip.

pip install aws-alb

Or directly install it through source.

./ -ic


It is usually hard to create a loadbalancer following best practices and rules. Also, most of the time the deployed loadbalancer will lack some configuration functionality for deployment management. We tackle these problems by providing you a library to easily deploy and maintain a loadbalancer with right security groups, right listeners and most importantly right configuration for blue-green deployments.


To create an application loadbalancer create an ApplicationLoadbalancer instance in your stack. An example is given below:

from aws_cdk import core, aws_ec2
from aws_alb.alb_traffic_enum import AlbTrafficEnum
from aws_alb.application_loadbalancer import ApplicationLoadbalancer

class MainStack(core.Stack):
    def __init__(self, scope: core.App) -> None:

        # Create your own vpc.
        self.vpc = aws_ec2.Vpc(

        self.public_http_loadbalancer = ApplicationLoadbalancer(

Release history


Bug fix.


Initial project.

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

aws_alb-1.0.1.tar.gz (5.1 kB view hashes)

Uploaded source

Built Distribution

aws_alb-1.0.1-py3-none-any.whl (18.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page