Go to file
2018-09-25 11:11:30 -04:00
src Add a counter for the number of groups we remove 2018-09-25 11:11:30 -04:00
.gitignore Initial commit 2017-10-20 07:10:25 -04:00
Dockerfile Add dockerfile 2018-09-25 10:48:55 -04:00
LICENSE Initial commit 2017-10-20 07:10:25 -04:00
README.md update readme 2017-10-20 13:47:13 -04:00

aws-target-group-cleanup

Remove ALB target groups that are not assigned to load balancers

Purpose

Clean up target groups that no longer have a load balancer assigned

Prerequisites

  • pip install boto3
  • Either an AWS role (if running on EC2) or an access key/secret key

Usage

Dry run mode:

python aws-target-group-cleanup.py -r us-west-2 -p myprefix

Removal mode:

python aws-target-group-cleanup.py -r us-west-2 -p myprefix -f

Where:

  • -r is the region
  • -p is an optional prefix (ie. only remove target groups starting with this)
  • -f will turn on the removal (run in dryrun mode without this flag)