AWS Shared ALB by EC2 instance tag

Posted on Mon 15 February 2021 in devops • Tagged with aws, lambda, python, alb, automation

motivation

in AWS setups, loadbalancers can be are quite cost-intensive.
If you are in a non-production environment, you probably do not need one LB for each (micro-)service.
This lambda function automatically adds ec2 instances to a targetgroup & adds a host-header-based rule to a single shared ALB

source

the sources, documentation and examples are located here