I get the following error when deploying to EB:
ERROR: You cannot have more than 500 Application Versions. Either remove some Application Versions or re
I find the solution here, the simple solution is to delete the previous versions as explained below.
To delete an application version
Open the Elastic Beanstalk console, and in the Regions list, select your AWS Region.
In the navigation pane, choose Applications, and then choose your application's name from the list.
Note
If you have many applications, use the search bar to filter the application list.
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.
(Optional) To leave the application source bundle for these application versions in your Amazon Simple Storage Service (Amazon S3) bucket, clear the box for Delete versions from Amazon S3.
Choose Delete.
Another solution
Go to version settings and enable lifecycle policy the way it is shown below.
Reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-versions.html