prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add ResourceLifecycleConfig to AWS::ElasticBeanstalk::Application
  [AWS::ElasticBeanstalk::Application](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html)
  Use the ResourceLifecycleConfig property to define lifecycle settings for resources that belong to the application, and the service role that Elastic Beanstalk assumes in order to apply lifecycle settings.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `troposphere/elasticbeanstalk.py`
  Content:
  ```
  1 # Copyright (c) 2013, Mark Peek <mark@peek.org>
  2 # All rights reserved.
  3 #
  4 # See LICENSE file for full license.
  5 
  6 from . import AWSObject, AWSProperty, Tags
  7 
  8 
  9 WebServer = "WebServer"
  10 Worker = "Worker"
  11 WebServerType = "Standard"
  12 WorkerType = "SQS/HTTP"
  13 
  14 
  15 class SourceBundle(AWSProperty):
  16     props = {
  17         'S3Bucket': (basestring, True),
  18         'S3Key': (basestring, True),
  19     }
  20 
  21 
  22 class SourceConfiguration(AWSProperty):
  23     props = {
  24         'ApplicationName': (basestring, True),
  25         'TemplateName': (basestring, True),
  26     }
  27 
  28 
  29 class OptionSettings(AWSProperty):
  30     props = {
  31         'Namespace': (basestring, True),
  32         'OptionName': (basestring, True),
  33         'Value': (basestring, True),
  34     }
  35 
  36 
  37 class Application(AWSObject):
  38     resource_type = "AWS::ElasticBeanstalk::Application"
  39 
  40     props = {
  41         'ApplicationName': (basestring, False),
  42         'Description': (basestring, False),
  43     }
  44 
  45 
  46 class ApplicationVersion(AWSObject):
  47     resource_type = "AWS::ElasticBeanstalk::ApplicationVersion"
  48 
  49     props = {
  50         'ApplicationName': (basestring, True),
  51         'Description': (basestring, False),
  52         'SourceBundle': (SourceBundle, False),
  53     }
  54 
  55 
  56 class ConfigurationTemplate(AWSObject):
  57     resource_type = "AWS::ElasticBeanstalk::ConfigurationTemplate"
  58 
  59     props = {
  60         'ApplicationName': (basestring, True),
  61         'Description': (basestring, False),
  62         'EnvironmentId': (basestring, False),
  63         'OptionSettings': ([OptionSettings], False),
  64         'SolutionStackName': (basestring, False),
  65         'SourceConfiguration': (SourceConfiguration, False),
  66     }
  67 
  68 
  69 def validate_tier_name(name):
  70     valid_names = [WebServer, Worker]
  71     if name not in valid_names:
  72         raise ValueError('Tier name needs to be one of %r' % valid_names)
  73     return name
  74 
  75 
  76 def validate_tier_type(tier_type):
  77     valid_types = [WebServerType, WorkerType]
  78     if tier_type not in valid_types:
  79         raise ValueError('Tier type needs to be one of %r' % valid_types)
  80     return tier_type
  81 
  82 
  83 class Tier(AWSProperty):
  84     props = {
  85         'Name': (validate_tier_name, False),
  86         'Type': (validate_tier_type, False),
  87         'Version': (basestring, False),
  88     }
  89 
  90 
  91 class Environment(AWSObject):
  92     resource_type = "AWS::ElasticBeanstalk::Environment"
  93 
  94     props = {
  95         'ApplicationName': (basestring, True),
  96         'CNAMEPrefix': (basestring, False),
  97         'Description': (basestring, False),
  98         'EnvironmentName': (basestring, False),
  99         'OptionSettings': ([OptionSettings], False),
  100         'SolutionStackName': (basestring, False),
  101         'Tags': (Tags, False),
  102         'TemplateName': (basestring, False),
  103         'Tier': (Tier, False),
  104         'VersionLabel': (basestring, False),
  105     }
  106
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/troposphere/elasticbeanstalk.py b/troposphere/elasticbeanstalk.py
  --- a/troposphere/elasticbeanstalk.py
  +++ b/troposphere/elasticbeanstalk.py
  @@ -4,7 +4,7 @@
   # See LICENSE file for full license.
   
   from . import AWSObject, AWSProperty, Tags
  -
  +from .validators import boolean, integer
   
   WebServer = "WebServer"
   Worker = "Worker"
  @@ -12,6 +12,29 @@
   WorkerType = "SQS/HTTP"
   
   
  +class MaxAgeRule(AWSProperty):
  +    props = {
  +      'DeleteSourceFromS3': (boolean, False),
  +      'Enabled': (boolean, False),
  +      'MaxAgeInDays': (integer, False),
  +    }
  +
  +
  +class MaxCountRule(AWSProperty):
  +    props = {
  +      'DeleteSourceFromS3': (boolean, False),
  +      'Enabled': (boolean, False),
  +      'MaxCount': (integer, False),
  +    }
  +
  +
  +class ApplicationVersionLifecycleConfig(AWSProperty):
  +    props = {
  +        'MaxAgeRule': (MaxAgeRule, False),
  +        'MaxCountRule': (MaxCountRule, False),
  +    }
  +
  +
   class SourceBundle(AWSProperty):
       props = {
           'S3Bucket': (basestring, True),
  @@ -26,6 +49,13 @@
       }
   
   
  +class ApplicationResourceLifecycleConfig(AWSProperty):
  +    props = {
  +        'ServiceRole': (basestring, False),
  +        'VersionLifecycleConfig': (ApplicationVersionLifecycleConfig, False),
  +    }
  +
  +
   class OptionSettings(AWSProperty):
       props = {
           'Namespace': (basestring, True),
  @@ -40,6 +70,7 @@
       props = {
           'ApplicationName': (basestring, False),
           'Description': (basestring, False),
  +        'ResourceLifecycleConfig': (ApplicationResourceLifecycleConfig, False),
       }
  
verification_info: {"golden_diff": "diff --git a/troposphere/elasticbeanstalk.py b/troposphere/elasticbeanstalk.py\n--- a/troposphere/elasticbeanstalk.py\n+++ b/troposphere/elasticbeanstalk.py\n@@ -4,7 +4,7 @@\n # See LICENSE file for full license.\n \n from . import AWSObject, AWSProperty, Tags\n-\n+from .validators import boolean, integer\n \n WebServer = \"WebServer\"\n Worker = \"Worker\"\n@@ -12,6 +12,29 @@\n WorkerType = \"SQS/HTTP\"\n \n \n+class MaxAgeRule(AWSProperty):\n+    props = {\n+      'DeleteSourceFromS3': (boolean, False),\n+      'Enabled': (boolean, False),\n+      'MaxAgeInDays': (integer, False),\n+    }\n+\n+\n+class MaxCountRule(AWSProperty):\n+    props = {\n+      'DeleteSourceFromS3': (boolean, False),\n+      'Enabled': (boolean, False),\n+      'MaxCount': (integer, False),\n+    }\n+\n+\n+class ApplicationVersionLifecycleConfig(AWSProperty):\n+    props = {\n+        'MaxAgeRule': (MaxAgeRule, False),\n+        'MaxCountRule': (MaxCountRule, False),\n+    }\n+\n+\n class SourceBundle(AWSProperty):\n     props = {\n         'S3Bucket': (basestring, True),\n@@ -26,6 +49,13 @@\n     }\n \n \n+class ApplicationResourceLifecycleConfig(AWSProperty):\n+    props = {\n+        'ServiceRole': (basestring, False),\n+        'VersionLifecycleConfig': (ApplicationVersionLifecycleConfig, False),\n+    }\n+\n+\n class OptionSettings(AWSProperty):\n     props = {\n         'Namespace': (basestring, True),\n@@ -40,6 +70,7 @@\n     props = {\n         'ApplicationName': (basestring, False),\n         'Description': (basestring, False),\n+        'ResourceLifecycleConfig': (ApplicationResourceLifecycleConfig, False),\n     }\n", "issue": "Add ResourceLifecycleConfig to AWS::ElasticBeanstalk::Application\n[AWS::ElasticBeanstalk::Application](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-beanstalk.html)\r\nUse the ResourceLifecycleConfig property to define lifecycle settings for resources that belong to the application, and the service role that Elastic Beanstalk assumes in order to apply lifecycle settings.\n", "before_files": [{"content": "# Copyright (c) 2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty, Tags\n\n\nWebServer = \"WebServer\"\nWorker = \"Worker\"\nWebServerType = \"Standard\"\nWorkerType = \"SQS/HTTP\"\n\n\nclass SourceBundle(AWSProperty):\n    props = {\n        'S3Bucket': (basestring, True),\n        'S3Key': (basestring, True),\n    }\n\n\nclass SourceConfiguration(AWSProperty):\n    props = {\n        'ApplicationName': (basestring, True),\n        'TemplateName': (basestring, True),\n    }\n\n\nclass OptionSettings(AWSProperty):\n    props = {\n        'Namespace': (basestring, True),\n        'OptionName': (basestring, True),\n        'Value': (basestring, True),\n    }\n\n\nclass Application(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::Application\"\n\n    props = {\n        'ApplicationName': (basestring, False),\n        'Description': (basestring, False),\n    }\n\n\nclass ApplicationVersion(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::ApplicationVersion\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'Description': (basestring, False),\n        'SourceBundle': (SourceBundle, False),\n    }\n\n\nclass ConfigurationTemplate(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::ConfigurationTemplate\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'Description': (basestring, False),\n        'EnvironmentId': (basestring, False),\n        'OptionSettings': ([OptionSettings], False),\n        'SolutionStackName': (basestring, False),\n        'SourceConfiguration': (SourceConfiguration, False),\n    }\n\n\ndef validate_tier_name(name):\n    valid_names = [WebServer, Worker]\n    if name not in valid_names:\n        raise ValueError('Tier name needs to be one of %r' % valid_names)\n    return name\n\n\ndef validate_tier_type(tier_type):\n    valid_types = [WebServerType, WorkerType]\n    if tier_type not in valid_types:\n        raise ValueError('Tier type needs to be one of %r' % valid_types)\n    return tier_type\n\n\nclass Tier(AWSProperty):\n    props = {\n        'Name': (validate_tier_name, False),\n        'Type': (validate_tier_type, False),\n        'Version': (basestring, False),\n    }\n\n\nclass Environment(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::Environment\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'CNAMEPrefix': (basestring, False),\n        'Description': (basestring, False),\n        'EnvironmentName': (basestring, False),\n        'OptionSettings': ([OptionSettings], False),\n        'SolutionStackName': (basestring, False),\n        'Tags': (Tags, False),\n        'TemplateName': (basestring, False),\n        'Tier': (Tier, False),\n        'VersionLabel': (basestring, False),\n    }\n", "path": "troposphere/elasticbeanstalk.py"}], "after_files": [{"content": "# Copyright (c) 2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSObject, AWSProperty, Tags\nfrom .validators import boolean, integer\n\nWebServer = \"WebServer\"\nWorker = \"Worker\"\nWebServerType = \"Standard\"\nWorkerType = \"SQS/HTTP\"\n\n\nclass MaxAgeRule(AWSProperty):\n    props = {\n      'DeleteSourceFromS3': (boolean, False),\n      'Enabled': (boolean, False),\n      'MaxAgeInDays': (integer, False),\n    }\n\n\nclass MaxCountRule(AWSProperty):\n    props = {\n      'DeleteSourceFromS3': (boolean, False),\n      'Enabled': (boolean, False),\n      'MaxCount': (integer, False),\n    }\n\n\nclass ApplicationVersionLifecycleConfig(AWSProperty):\n    props = {\n        'MaxAgeRule': (MaxAgeRule, False),\n        'MaxCountRule': (MaxCountRule, False),\n    }\n\n\nclass SourceBundle(AWSProperty):\n    props = {\n        'S3Bucket': (basestring, True),\n        'S3Key': (basestring, True),\n    }\n\n\nclass SourceConfiguration(AWSProperty):\n    props = {\n        'ApplicationName': (basestring, True),\n        'TemplateName': (basestring, True),\n    }\n\n\nclass ApplicationResourceLifecycleConfig(AWSProperty):\n    props = {\n        'ServiceRole': (basestring, False),\n        'VersionLifecycleConfig': (ApplicationVersionLifecycleConfig, False),\n    }\n\n\nclass OptionSettings(AWSProperty):\n    props = {\n        'Namespace': (basestring, True),\n        'OptionName': (basestring, True),\n        'Value': (basestring, True),\n    }\n\n\nclass Application(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::Application\"\n\n    props = {\n        'ApplicationName': (basestring, False),\n        'Description': (basestring, False),\n        'ResourceLifecycleConfig': (ApplicationResourceLifecycleConfig, False),\n    }\n\n\nclass ApplicationVersion(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::ApplicationVersion\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'Description': (basestring, False),\n        'SourceBundle': (SourceBundle, False),\n    }\n\n\nclass ConfigurationTemplate(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::ConfigurationTemplate\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'Description': (basestring, False),\n        'EnvironmentId': (basestring, False),\n        'OptionSettings': ([OptionSettings], False),\n        'SolutionStackName': (basestring, False),\n        'SourceConfiguration': (SourceConfiguration, False),\n    }\n\n\ndef validate_tier_name(name):\n    valid_names = [WebServer, Worker]\n    if name not in valid_names:\n        raise ValueError('Tier name needs to be one of %r' % valid_names)\n    return name\n\n\ndef validate_tier_type(tier_type):\n    valid_types = [WebServerType, WorkerType]\n    if tier_type not in valid_types:\n        raise ValueError('Tier type needs to be one of %r' % valid_types)\n    return tier_type\n\n\nclass Tier(AWSProperty):\n    props = {\n        'Name': (validate_tier_name, False),\n        'Type': (validate_tier_type, False),\n        'Version': (basestring, False),\n    }\n\n\nclass Environment(AWSObject):\n    resource_type = \"AWS::ElasticBeanstalk::Environment\"\n\n    props = {\n        'ApplicationName': (basestring, True),\n        'CNAMEPrefix': (basestring, False),\n        'Description': (basestring, False),\n        'EnvironmentName': (basestring, False),\n        'OptionSettings': ([OptionSettings], False),\n        'SolutionStackName': (basestring, False),\n        'Tags': (Tags, False),\n        'TemplateName': (basestring, False),\n        'Tier': (Tier, False),\n        'VersionLabel': (basestring, False),\n    }\n", "path": "troposphere/elasticbeanstalk.py"}]}