I get the following error when deploying to EB:
ERROR: You cannot have more than 500 Application Versions. Either remove some Application Versions or request a limit increase.
I went manually and deleted some versions. I don't want deploys to fail because of this limit. Is there a way in Elastic Beanstalk to auto-evict unused versions?
Elastic Beanstalk applies an application's lifecycle policy each time you create a new application version, and deletes up to 100 versions each time the lifecycle policy is applied.
AWS Elastic Beanstalk uses proven AWS features and services, such as Amazon EC2, Amazon RDS, Elastic Load Balancing, Auto Scaling, Amazon S3, and Amazon SNS, to create an environment that runs your application. The current version of AWS Elastic Beanstalk uses the Amazon Linux AMI or the Windows Server 2019.
A feature was recently added to eb cli (v3.3) to cleanup old versions
https://m.reddit.com/r/aws/comments/340ce0/whats_the_thinking_behind_beanstalks_versioning/
Copying command from reddit link
$ eb labs cleanup-versions --help usage: eb labs cleanup-versions [options...] Cleans up old application versions. optional arguments: --num-to-leave NUM number of versions to leave DEFAULT=10 --older-than DAYS delete only versions older than x days DEFAULT=60 --force don't prompt for confirmation
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