Lately has anyone witnessed the
TooManyApplicationVersions Exception
on AWS Elastic Beanstalk console while deploying a new application version (war)? It's so annoying to see this message as it appears only after you have finished uploading the war.
I would be interested to know why this exception occurs and what precautions one should take to avoid such situations?
The exception you are seeing stems from reaching your respective account limits for AWS Elastic Beanstalk, see section Errors in CreateApplicationVersion [paraphrased]:
- TooManyApplicationVersions - The caller has exceeded the limit on the number of application versions associated with their account.
- TooManyApplications - The caller has exceeded the limit on the number of applications associated with their account.
The current limits are outlined in the respective FAQ How many applications can I run with AWS Elastic Beanstalk?:
You can create up to 25 applications and 500 application versions. By default you can run up to 10 environments across all of your applications. If you are also using AWS outside of Elastic Beanstalk, you may not be [...] If you need more resources, complete the AWS Elastic Beanstalk request form and your request will be promptly evaluated. [emphasis mine]
As emphasized, AWS offers the usual escalation option and allows you to submit a Request to Increase AWS Elastic Beanstalk Limits, if you really need that many application versions to be available for reuse still. Otherwise you might just delete older ones you will not use anymore and the problem should vanish accordingly.
Good luck!
Here's a one liner that uses the AWS CLI that will help you clear out old application versions:
aws elasticbeanstalk describe-application-versions --output text --query 'ApplicationVersions[*].[ApplicationName,VersionLabel,DateCreated]' | grep "2014-02" | while read app ver date; do aws elasticbeanstalk delete-application-version --application-name $app --version-label $ver --delete-source-bundle; done
Replace the grep with whatever date, (2013, 2014-01, 2014-02-0, etc) you see fit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With