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
In the Actions drop-down on the right hand side of the application you'd like to manage, click View application versions.
Click on the Settings button on the top right and you'll be able to configure the amount of versions you'd like to keep around:
If you have already reached the limit, you must manually first delete some versions to allow this lifecycle policy to kick in (for an explanation read the note below).
From the Configuring Application Version Lifecycle Settings documentation:
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. Elastic Beanstalk deletes old versions after creating the new version, and does not count the new version towards the maximum number of versions defined in the policy.
Elastic Beanstalk does not delete application versions that are currently being used by an environment, or application versions deployed to environments that were terminated less than ten weeks before the policy was triggered.
The application version limit applies across all applications in a region. If you have several applications, configure each application with a lifecycle policy appropriate to avoid reaching the limit. Elastic Beanstalk only applies the policy if the application version creation succeeds, so if you have already reached the limit, you must delete some versions manually prior to creating a new version.