Skip to content

Instantly share code, notes, and snippets.

@timdp
Last active January 3, 2017 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timdp/e8114b8f7c7ba87a5f3de8c8711a36be to your computer and use it in GitHub Desktop.
Save timdp/e8114b8f7c7ba87a5f3de8c8711a36be to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
region=${1:-us-east-1}
count=${2:-100}
aws --region $region elasticbeanstalk describe-application-versions |
jq -r '.ApplicationVersions[] | .ApplicationName + " " + .VersionLabel' |
head -$count |
while read app label; do
echo "Deleting: $app @ $label"
aws --region $region elasticbeanstalk delete-application-version --application-name "$app" --version-label "$label"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment