Written by , Updated on September 19, 2020

One of my application is configured for auto deployment with Code Deploy and Elastic Beanstalk on AWS hosting. Today the deployment failed with the error message “Too many application versions, cannot create a new version for application my-app“. See the below screenshot of error message:

How To Delete Application Versions from AWS Beanstalk Amazon Web Services AWS beanstalk codedeploy

After searching about the issue, I found that Elastic Beanstalk keeps all application version’s deployed in past. So when we deploy a new version it keeps old version and there is a limit of 500 versions (by default) per region per AWS account. To delete the old version follow below steps:

Delete Beanstalk Application Versions

  1. Login to AWS account and Open the Elastic Beanstalk console
  2. Choose Applications in navigation pane, and then select your application name from the list

    How To Delete Application Versions from AWS Beanstalk Amazon Web Services AWS beanstalk codedeploy

  3. In the navigation pane, find your application’s name and choose Application versions. Select one or more application versions that you want to delete.

    Choose Actions, then choose Delete.

    How To Delete Application Versions from AWS Beanstalk Amazon Web Services AWS beanstalk codedeploy

  4. Delete application versions dialog on the Application Versions page of the Elastic Beanstalk console

    How To Delete Application Versions from AWS Beanstalk Amazon Web Services AWS beanstalk codedeploy

    Then click Delete button to delete all versions.

    (Optional) You can clear the check box for Delete versions from Amazon S3 to leave the application source bundle for these application versions in your Amazon Simple Storage Service (Amazon S3) bucket.

You can also configure to delete Elastic Beanstalk old versions automatically. To do this you need to enable application version lifecycle settings. Which will also applied to the new application versions.

How To Delete Application Versions from AWS Beanstalk Amazon Web Services AWS beanstalk codedeploy

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..