Since December 22th 2016 you are able to configure application version lifecycle in Beanstalk.
Very convenient, we can trash our custom api cleaning scripts :-)
-
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-lifecycle.html