Correct answer - "Use a Lifecycle Policy" : Each time you upload a new version of your
application with the Elastic Beanstalk console or the EB CLI, Elastic Beanstalk creates an
application version. If you don't delete versions that you no longer use, you will eventually
reach the application version limit and be unable to create new versions of that application.
You can avoid hitting the limit by applying an application version lifecycle policy to your
applications. A lifecycle policy tells Elastic Beanstalk to delete application versions that are
old, or to delete application versions when the total number of versions for an application
exceeds a specified number.
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.
Incorrect Answers -
"Setup an .ebextensions files" - This won't help as the setting is higher up and the environment
configuration
"Define a Lambda function" - This could work but would require a lot of manual scripting, to
achieve the same desired effect as the Lifecycle Policy EB feature.
"Use Worker Environments" - This won't help. If your application performs operations or workflows
that take a long time to complete, you can offload those tasks to a dedicated worker
environment. Decoupling your web application front end from a process that performs blocking
operations is a common way to ensure that your application stays responsive under load.
For more information visit