Skip to content

Instantly share code, notes, and snippets.

@jsyi
Last active November 27, 2017 07:14
Show Gist options
  • Save jsyi/563293932419440957cbe39cfa473ab3 to your computer and use it in GitHub Desktop.
Save jsyi/563293932419440957cbe39cfa473ab3 to your computer and use it in GitHub Desktop.
See how many application versions each Elastic Beanstalk application is using from the command line. Useful for monitoring how close we are to AWS Service Limits.
#!/bin/bash
# Requires AWS CLI Tools (https://aws.amazon.com/cli) and jq (https://stedolan.github.io/jq)
# AWS CLI must be configured with access key with approperiate role/permissions
aws elasticbeanstalk describe-application-versions --query "ApplicationVersions[*].ApplicationName" | jq '{"total": length, "lists": group_by(.)} | {"Applications": [ (.lists[] | {"Application": .[0], "Versions": length })], "Total Versions": .total }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment