Skip to main content

reap dangling packer builder machines on AWS

Project description

AWS Hashicorp Packer Reaper

Hashicorp Packer is a great tool for building Amazon Machine Images. However, sometimes the virtual machine running packer is not stopped. This utility:

  1. stops or terminated all virtual machines with the name tag 'Packer Builder'

You can use it as a command line utility or install it as an AWS Lambda function and stop the spend , NoOps style!

install the packer reaper

to install the packer reaper, type:

pip install aws-hashicorp-packer-reaper

show running packer instances

To show running packer instances:

aws-hashicorp-packer-reaper list

stop running packer instances

To stop running packer instances older than 2 hours:

aws-hashicorp-packer-reaper stop --dry-run --older-than 2h

terminate running packer instances

To terminate stopped and running packer instances older than 24 hours:

aws-hashicorp-packer-reaper terminate --dry-run --older-than 24h

deploy the packer reaper

To deploy the packer reaper as an AWS Lambda, type:

git clone https://github.com/binxio/aws-hashicorp-packer-reaper.git
cd aws-hashicorp-packer-reaper
aws cloudformation deploy \
	--capabilities CAPABILITY_IAM \
	--stack-name aws-hashicorp-packer-reaper \
	--template-file ./cloudformation/aws-hashicorp-packer-reaper.yaml

This will install the packer reaper in your AWS account and run every hour, stopping packer instances launhed more than 2 hours ago and terminate instanced older than 24 hours.

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-hashicorp-packer-reaper-0.1.0.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file aws-hashicorp-packer-reaper-0.1.0.tar.gz.

File metadata

  • Download URL: aws-hashicorp-packer-reaper-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 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.7.5

File hashes

Hashes for aws-hashicorp-packer-reaper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10e904d7feb4945c7178317fccbd53dcff1ece24b0884b8c471698b62f711f49
MD5 256e4952c6b07fba379f0414be82d890
BLAKE2b-256 81d37f9102b00fcd5770305b73dc2262fd7d07ad89aa06eac3a42d24202d0309

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page