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.

Remarks

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.

Assumptions

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.

Install

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

pip install aws-alb

Or directly install it through source.

./build.sh -ic

Description

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.

Examples

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:
        super().__init__(
            scope=scope,
            id='MyCoolStack'
        )

        # Create your own vpc.
        self.vpc = aws_ec2.Vpc(
            self,
            'MyCoolVpc'
        )

        self.public_http_loadbalancer = ApplicationLoadbalancer(
            scope=self,
            prefix='MyCool',
            vpc=self.vpc,
            loadbalancer_subnets=self.vpc.public_subnets,
            security_groups=None,
            inbound_traffic=AlbTrafficEnum.INTERNET,
            outbound_traffic=AlbTrafficEnum.INTERNET,
            certificate=None
        )

Release history

2.0.0

Complete refactor. Instead of creating default listeners add an ability to create custom listeners and target groups. The loadbalancer now exposes an explicit method to easily create a pair of listeners and a pair of target groups for easy out-of-the-box blue/green deployment configuration.

1.0.2

Renames.

1.0.1

Bug fix.

1.0.0

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-2.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

aws_alb-2.0.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file aws_alb-2.0.0.tar.gz.

File metadata

  • Download URL: aws_alb-2.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.8

File hashes

Hashes for aws_alb-2.0.0.tar.gz
Algorithm Hash digest
SHA256 2c58fa669afbb0a4bedb5c3d2591017991ebcf29c88132654f0957447f2b6792
MD5 2aa3b49fd08cd4008d160a66e6f67274
BLAKE2b-256 1c33cd6a85111ff2da2a7073e91a3dab68d3f861b8760f52a8c06918fc5767f1

See more details on using hashes here.

File details

Details for the file aws_alb-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: aws_alb-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.8

File hashes

Hashes for aws_alb-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc9a30463a9c8fde3a3b39aaa5e719145cbbd6b5f13a966be1e3a83f05c8e05
MD5 82904078baa32f96745da6cf509a88f7
BLAKE2b-256 1f573974ec14e9fa5a7cb6621f72a658281823e0bc52f4bb67bb642326a2063d

See more details on using hashes here.

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