We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
AutoScalingGroup LaunchConfigurationName requirement
AWS::AutoScaling::AutoScalingGroup<sup>1</sup>  specifies that the LaunchConfigurationName and InstanceId fields are conditionally required (one must be present, and they are mutually exclusive) but the Troposphere class 'AutoScalingGroup' requires the LaunchConfigurationName parameter unconditionally. The result of this is that an autoscaling group requiring an InstanceId can not be provisioned through the 'AutoScalingGroup' class.

<sup>1</sup> (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-instanceid)


--- 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/autoscaling.py`
Content:
```
1 # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
2 # All rights reserved.
3 #
4 # See LICENSE file for full license.
5 
6 from . import AWSHelperFn, AWSObject, AWSProperty, Ref
7 from .validators import boolean, integer
8 from . import cloudformation
9 
10 
11 EC2_INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH"
12 EC2_INSTANCE_LAUNCH_ERROR = "autoscaling:EC2_INSTANCE_LAUNCH_ERROR"
13 EC2_INSTANCE_TERMINATE = "autoscaling:EC2_INSTANCE_TERMINATE"
14 EC2_INSTANCE_TERMINATE_ERROR = "autoscaling:EC2_INSTANCE_TERMINATE_ERROR"
15 TEST_NOTIFICATION = "autoscaling:TEST_NOTIFICATION"
16 
17 # Termination Policy constants
18 Default = 'Default'
19 OldestInstance = 'OldestInstance'
20 NewestInstance = 'NewestInstance'
21 OldestLaunchConfiguration = 'OldestLaunchConfiguration'
22 ClosestToNextInstanceHour = 'ClosestToNextInstanceHour'
23 
24 
25 class Tag(AWSHelperFn):
26     def __init__(self, key, value, propogate):
27         self.data = {
28             'Key': key,
29             'Value': value,
30             'PropagateAtLaunch': propogate,
31         }
32 
33     def JSONrepr(self):
34         return self.data
35 
36 
37 class Tags(AWSHelperFn):
38     defaultPropagateAtLaunch = True
39     manyType = [type([]), type(())]
40 
41     def __init__(self, **kwargs):
42         self.tags = []
43         for k, v in sorted(kwargs.iteritems()):
44             if type(v) in self.manyType:
45                 propagate = str(v[1]).lower()
46                 v = v[0]
47             else:
48                 propagate = str(self.defaultPropagateAtLaunch).lower()
49             self.tags.append({
50                 'Key': k,
51                 'Value': v,
52                 'PropagateAtLaunch': propagate,
53             })
54 
55     def JSONrepr(self):
56         return self.tags
57 
58 
59 class NotificationConfiguration(AWSProperty):
60     props = {
61         'TopicARN': (basestring, True),
62         'NotificationTypes': (list, True),
63     }
64 
65 
66 class MetricsCollection(AWSProperty):
67     props = {
68         'Granularity': (basestring, True),
69         'Metrics': (list, False),
70     }
71 
72 
73 class Metadata(AWSHelperFn):
74     def __init__(self, init, authentication=None):
75         self.validate(init, authentication)
76         # get keys and values from init and authentication
77         # safe to use cause its always one key
78         initKey, initValue = init.data.popitem()
79         self.data = {initKey: initValue}
80         if authentication:
81             authKey, authValue = authentication.data.popitem()
82             self.data[authKey] = authValue
83 
84     def validate(self, init, authentication):
85         if not isinstance(init, cloudformation.Init):
86             raise ValueError(
87                 'init must be of type cloudformation.Init'
88             )
89 
90         is_instance = isinstance(authentication, cloudformation.Authentication)
91         if authentication and not is_instance:
92             raise ValueError(
93                 'authentication must be of type cloudformation.Authentication'
94             )
95 
96     def JSONrepr(self):
97         return self.data
98 
99 
100 class AutoScalingGroup(AWSObject):
101     resource_type = "AWS::AutoScaling::AutoScalingGroup"
102 
103     props = {
104         'AvailabilityZones': (list, True),
105         'Cooldown': (integer, False),
106         'DesiredCapacity': (integer, False),
107         'HealthCheckGracePeriod': (int, False),
108         'HealthCheckType': (basestring, False),
109         'InstanceId': (basestring, False),
110         'LaunchConfigurationName': (basestring, True),
111         'LoadBalancerNames': (list, False),
112         'MaxSize': (integer, True),
113         'MetricsCollection': ([MetricsCollection], False),
114         'MinSize': (integer, True),
115         'NotificationConfiguration': (NotificationConfiguration, False),
116         'PlacementGroup': (basestring, False),
117         'Tags': (list, False),  # Although docs say these are required
118         'TerminationPolicies': ([basestring], False),
119         'VPCZoneIdentifier': (list, False),
120     }
121 
122     def validate(self):
123         if 'UpdatePolicy' in self.resource:
124             update_policy = self.resource['UpdatePolicy']
125 
126             isMinRef = isinstance(update_policy.MinInstancesInService, Ref)
127             isMaxRef = isinstance(self.MaxSize, Ref)
128 
129             if not (isMinRef or isMaxRef):
130                 minCount = int(update_policy.MinInstancesInService)
131                 maxCount = int(self.MaxSize)
132 
133                 if minCount >= maxCount:
134                     raise ValueError(
135                         "The UpdatePolicy attribute "
136                         "MinInstancesInService must be less than the "
137                         "autoscaling group's MaxSize")
138         return True
139 
140 
141 class LaunchConfiguration(AWSObject):
142     resource_type = "AWS::AutoScaling::LaunchConfiguration"
143 
144     props = {
145         'AssociatePublicIpAddress': (boolean, False),
146         'BlockDeviceMappings': (list, False),
147         'EbsOptimized': (boolean, False),
148         'IamInstanceProfile': (basestring, False),
149         'ImageId': (basestring, True),
150         'InstanceId': (basestring, False),
151         'InstanceMonitoring': (boolean, False),
152         'InstanceType': (basestring, True),
153         'KernelId': (basestring, False),
154         'KeyName': (basestring, False),
155         'Metadata': (Metadata, False),
156         'RamDiskId': (basestring, False),
157         'SecurityGroups': (list, False),
158         'SpotPrice': (basestring, False),
159         'UserData': (basestring, False),
160     }
161 
162 
163 class ScalingPolicy(AWSObject):
164     resource_type = "AWS::AutoScaling::ScalingPolicy"
165 
166     props = {
167         'AdjustmentType': (basestring, True),
168         'AutoScalingGroupName': (basestring, True),
169         'Cooldown': (integer, False),
170         'ScalingAdjustment': (basestring, True),
171     }
172 
173 
174 class ScheduledAction(AWSObject):
175     resource_type = "AWS::AutoScaling::ScheduledAction"
176 
177     props = {
178         'AutoScalingGroupName': (basestring, True),
179         'DesiredCapacity': (integer, False),
180         'EndTime': (basestring, True),
181         'MaxSize': (integer, False),
182         'MinSize': (integer, False),
183         'Recurrence': (basestring, True),
184         'StartTime': (basestring, True),
185     }
186 
187 
188 class Trigger(AWSObject):
189     resource_type = "AWS::AutoScaling::Trigger"
190 
191     props = {
192         'AutoScalingGroupName': (basestring, True),
193         'BreachDuration': (integer, True),
194         'Dimensions': (list, True),
195         'LowerBreachScaleIncrement': (integer, False),
196         'LowerThreshold': (integer, True),
197         'MetricName': (basestring, True),
198         'Namespace': (basestring, True),
199         'Period': (integer, True),
200         'Statistic': (basestring, True),
201         'Unit': (basestring, False),
202         'UpperBreachScaleIncrement': (integer, False),
203         'UpperThreshold': (integer, True),
204     }
205 
206 
207 class EBSBlockDevice(AWSProperty):
208     # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-template.html
209     props = {
210         'DeleteOnTermination': (boolean, False),
211         'Iops': (integer, False),
212         'SnapshotId': (basestring, False),
213         'VolumeSize': (integer, False),
214         'VolumeType': (basestring, False),
215     }
216 
217 
218 class BlockDeviceMapping(AWSProperty):
219     # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-mapping.html
220     props = {
221         'DeviceName': (basestring, True),
222         'Ebs': (EBSBlockDevice, False),
223         'NoDevice': (boolean, False),
224         'VirtualName': (basestring, False),
225     }
226
```
--- 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()

```

diff --git a/troposphere/autoscaling.py b/troposphere/autoscaling.py
--- a/troposphere/autoscaling.py
+++ b/troposphere/autoscaling.py
@@ -107,7 +107,7 @@
         'HealthCheckGracePeriod': (int, False),
         'HealthCheckType': (basestring, False),
         'InstanceId': (basestring, False),
-        'LaunchConfigurationName': (basestring, True),
+        'LaunchConfigurationName': (basestring, False),
         'LoadBalancerNames': (list, False),
         'MaxSize': (integer, True),
         'MetricsCollection': ([MetricsCollection], False),
@@ -135,6 +135,16 @@
                         "The UpdatePolicy attribute "
                         "MinInstancesInService must be less than the "
                         "autoscaling group's MaxSize")
+        launch_config = self.properties.get('LaunchConfigurationName')
+        instance_id = self.properties.get('InstanceId')
+        if launch_config and instance_id:
+            raise ValueError("LaunchConfigurationName and InstanceId "
+                             "are mutually exclusive.")
+        if not launch_config and not instance_id:
+            raise ValueError("Must specify either LaunchConfigurationName or "
+                             "InstanceId: http://docs.aws.amazon.com/AWSCloud"
+                             "Formation/latest/UserGuide/aws-properties-as-gr"
+                             "oup.html#cfn-as-group-instanceid")
         return True

{"golden_diff": "diff --git a/troposphere/autoscaling.py b/troposphere/autoscaling.py\n--- a/troposphere/autoscaling.py\n+++ b/troposphere/autoscaling.py\n@@ -107,7 +107,7 @@\n         'HealthCheckGracePeriod': (int, False),\n         'HealthCheckType': (basestring, False),\n         'InstanceId': (basestring, False),\n-        'LaunchConfigurationName': (basestring, True),\n+        'LaunchConfigurationName': (basestring, False),\n         'LoadBalancerNames': (list, False),\n         'MaxSize': (integer, True),\n         'MetricsCollection': ([MetricsCollection], False),\n@@ -135,6 +135,16 @@\n                         \"The UpdatePolicy attribute \"\n                         \"MinInstancesInService must be less than the \"\n                         \"autoscaling group's MaxSize\")\n+        launch_config = self.properties.get('LaunchConfigurationName')\n+        instance_id = self.properties.get('InstanceId')\n+        if launch_config and instance_id:\n+            raise ValueError(\"LaunchConfigurationName and InstanceId \"\n+                             \"are mutually exclusive.\")\n+        if not launch_config and not instance_id:\n+            raise ValueError(\"Must specify either LaunchConfigurationName or \"\n+                             \"InstanceId: http://docs.aws.amazon.com/AWSCloud\"\n+                             \"Formation/latest/UserGuide/aws-properties-as-gr\"\n+                             \"oup.html#cfn-as-group-instanceid\")\n         return True\n", "issue": "AutoScalingGroup LaunchConfigurationName requirement\nAWS::AutoScaling::AutoScalingGroup<sup>1</sup>  specifies that the LaunchConfigurationName and InstanceId fields are conditionally required (one must be present, and they are mutually exclusive) but the Troposphere class 'AutoScalingGroup' requires the LaunchConfigurationName parameter unconditionally. The result of this is that an autoscaling group requiring an InstanceId can not be provisioned through the 'AutoScalingGroup' class.\n\n<sup>1</sup> (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-instanceid)\n\n", "before_files": [{"content": "# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSHelperFn, AWSObject, AWSProperty, Ref\nfrom .validators import boolean, integer\nfrom . import cloudformation\n\n\nEC2_INSTANCE_LAUNCH = \"autoscaling:EC2_INSTANCE_LAUNCH\"\nEC2_INSTANCE_LAUNCH_ERROR = \"autoscaling:EC2_INSTANCE_LAUNCH_ERROR\"\nEC2_INSTANCE_TERMINATE = \"autoscaling:EC2_INSTANCE_TERMINATE\"\nEC2_INSTANCE_TERMINATE_ERROR = \"autoscaling:EC2_INSTANCE_TERMINATE_ERROR\"\nTEST_NOTIFICATION = \"autoscaling:TEST_NOTIFICATION\"\n\n# Termination Policy constants\nDefault = 'Default'\nOldestInstance = 'OldestInstance'\nNewestInstance = 'NewestInstance'\nOldestLaunchConfiguration = 'OldestLaunchConfiguration'\nClosestToNextInstanceHour = 'ClosestToNextInstanceHour'\n\n\nclass Tag(AWSHelperFn):\n    def __init__(self, key, value, propogate):\n        self.data = {\n            'Key': key,\n            'Value': value,\n            'PropagateAtLaunch': propogate,\n        }\n\n    def JSONrepr(self):\n        return self.data\n\n\nclass Tags(AWSHelperFn):\n    defaultPropagateAtLaunch = True\n    manyType = [type([]), type(())]\n\n    def __init__(self, **kwargs):\n        self.tags = []\n        for k, v in sorted(kwargs.iteritems()):\n            if type(v) in self.manyType:\n                propagate = str(v[1]).lower()\n                v = v[0]\n            else:\n                propagate = str(self.defaultPropagateAtLaunch).lower()\n            self.tags.append({\n                'Key': k,\n                'Value': v,\n                'PropagateAtLaunch': propagate,\n            })\n\n    def JSONrepr(self):\n        return self.tags\n\n\nclass NotificationConfiguration(AWSProperty):\n    props = {\n        'TopicARN': (basestring, True),\n        'NotificationTypes': (list, True),\n    }\n\n\nclass MetricsCollection(AWSProperty):\n    props = {\n        'Granularity': (basestring, True),\n        'Metrics': (list, False),\n    }\n\n\nclass Metadata(AWSHelperFn):\n    def __init__(self, init, authentication=None):\n        self.validate(init, authentication)\n        # get keys and values from init and authentication\n        # safe to use cause its always one key\n        initKey, initValue = init.data.popitem()\n        self.data = {initKey: initValue}\n        if authentication:\n            authKey, authValue = authentication.data.popitem()\n            self.data[authKey] = authValue\n\n    def validate(self, init, authentication):\n        if not isinstance(init, cloudformation.Init):\n            raise ValueError(\n                'init must be of type cloudformation.Init'\n            )\n\n        is_instance = isinstance(authentication, cloudformation.Authentication)\n        if authentication and not is_instance:\n            raise ValueError(\n                'authentication must be of type cloudformation.Authentication'\n            )\n\n    def JSONrepr(self):\n        return self.data\n\n\nclass AutoScalingGroup(AWSObject):\n    resource_type = \"AWS::AutoScaling::AutoScalingGroup\"\n\n    props = {\n        'AvailabilityZones': (list, True),\n        'Cooldown': (integer, False),\n        'DesiredCapacity': (integer, False),\n        'HealthCheckGracePeriod': (int, False),\n        'HealthCheckType': (basestring, False),\n        'InstanceId': (basestring, False),\n        'LaunchConfigurationName': (basestring, True),\n        'LoadBalancerNames': (list, False),\n        'MaxSize': (integer, True),\n        'MetricsCollection': ([MetricsCollection], False),\n        'MinSize': (integer, True),\n        'NotificationConfiguration': (NotificationConfiguration, False),\n        'PlacementGroup': (basestring, False),\n        'Tags': (list, False),  # Although docs say these are required\n        'TerminationPolicies': ([basestring], False),\n        'VPCZoneIdentifier': (list, False),\n    }\n\n    def validate(self):\n        if 'UpdatePolicy' in self.resource:\n            update_policy = self.resource['UpdatePolicy']\n\n            isMinRef = isinstance(update_policy.MinInstancesInService, Ref)\n            isMaxRef = isinstance(self.MaxSize, Ref)\n\n            if not (isMinRef or isMaxRef):\n                minCount = int(update_policy.MinInstancesInService)\n                maxCount = int(self.MaxSize)\n\n                if minCount >= maxCount:\n                    raise ValueError(\n                        \"The UpdatePolicy attribute \"\n                        \"MinInstancesInService must be less than the \"\n                        \"autoscaling group's MaxSize\")\n        return True\n\n\nclass LaunchConfiguration(AWSObject):\n    resource_type = \"AWS::AutoScaling::LaunchConfiguration\"\n\n    props = {\n        'AssociatePublicIpAddress': (boolean, False),\n        'BlockDeviceMappings': (list, False),\n        'EbsOptimized': (boolean, False),\n        'IamInstanceProfile': (basestring, False),\n        'ImageId': (basestring, True),\n        'InstanceId': (basestring, False),\n        'InstanceMonitoring': (boolean, False),\n        'InstanceType': (basestring, True),\n        'KernelId': (basestring, False),\n        'KeyName': (basestring, False),\n        'Metadata': (Metadata, False),\n        'RamDiskId': (basestring, False),\n        'SecurityGroups': (list, False),\n        'SpotPrice': (basestring, False),\n        'UserData': (basestring, False),\n    }\n\n\nclass ScalingPolicy(AWSObject):\n    resource_type = \"AWS::AutoScaling::ScalingPolicy\"\n\n    props = {\n        'AdjustmentType': (basestring, True),\n        'AutoScalingGroupName': (basestring, True),\n        'Cooldown': (integer, False),\n        'ScalingAdjustment': (basestring, True),\n    }\n\n\nclass ScheduledAction(AWSObject):\n    resource_type = \"AWS::AutoScaling::ScheduledAction\"\n\n    props = {\n        'AutoScalingGroupName': (basestring, True),\n        'DesiredCapacity': (integer, False),\n        'EndTime': (basestring, True),\n        'MaxSize': (integer, False),\n        'MinSize': (integer, False),\n        'Recurrence': (basestring, True),\n        'StartTime': (basestring, True),\n    }\n\n\nclass Trigger(AWSObject):\n    resource_type = \"AWS::AutoScaling::Trigger\"\n\n    props = {\n        'AutoScalingGroupName': (basestring, True),\n        'BreachDuration': (integer, True),\n        'Dimensions': (list, True),\n        'LowerBreachScaleIncrement': (integer, False),\n        'LowerThreshold': (integer, True),\n        'MetricName': (basestring, True),\n        'Namespace': (basestring, True),\n        'Period': (integer, True),\n        'Statistic': (basestring, True),\n        'Unit': (basestring, False),\n        'UpperBreachScaleIncrement': (integer, False),\n        'UpperThreshold': (integer, True),\n    }\n\n\nclass EBSBlockDevice(AWSProperty):\n    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-template.html\n    props = {\n        'DeleteOnTermination': (boolean, False),\n        'Iops': (integer, False),\n        'SnapshotId': (basestring, False),\n        'VolumeSize': (integer, False),\n        'VolumeType': (basestring, False),\n    }\n\n\nclass BlockDeviceMapping(AWSProperty):\n    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-mapping.html\n    props = {\n        'DeviceName': (basestring, True),\n        'Ebs': (EBSBlockDevice, False),\n        'NoDevice': (boolean, False),\n        'VirtualName': (basestring, False),\n    }\n", "path": "troposphere/autoscaling.py"}], "after_files": [{"content": "# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>\n# All rights reserved.\n#\n# See LICENSE file for full license.\n\nfrom . import AWSHelperFn, AWSObject, AWSProperty, Ref\nfrom .validators import boolean, integer\nfrom . import cloudformation\n\n\nEC2_INSTANCE_LAUNCH = \"autoscaling:EC2_INSTANCE_LAUNCH\"\nEC2_INSTANCE_LAUNCH_ERROR = \"autoscaling:EC2_INSTANCE_LAUNCH_ERROR\"\nEC2_INSTANCE_TERMINATE = \"autoscaling:EC2_INSTANCE_TERMINATE\"\nEC2_INSTANCE_TERMINATE_ERROR = \"autoscaling:EC2_INSTANCE_TERMINATE_ERROR\"\nTEST_NOTIFICATION = \"autoscaling:TEST_NOTIFICATION\"\n\n# Termination Policy constants\nDefault = 'Default'\nOldestInstance = 'OldestInstance'\nNewestInstance = 'NewestInstance'\nOldestLaunchConfiguration = 'OldestLaunchConfiguration'\nClosestToNextInstanceHour = 'ClosestToNextInstanceHour'\n\n\nclass Tag(AWSHelperFn):\n    def __init__(self, key, value, propogate):\n        self.data = {\n            'Key': key,\n            'Value': value,\n            'PropagateAtLaunch': propogate,\n        }\n\n    def JSONrepr(self):\n        return self.data\n\n\nclass Tags(AWSHelperFn):\n    defaultPropagateAtLaunch = True\n    manyType = [type([]), type(())]\n\n    def __init__(self, **kwargs):\n        self.tags = []\n        for k, v in sorted(kwargs.iteritems()):\n            if type(v) in self.manyType:\n                propagate = str(v[1]).lower()\n                v = v[0]\n            else:\n                propagate = str(self.defaultPropagateAtLaunch).lower()\n            self.tags.append({\n                'Key': k,\n                'Value': v,\n                'PropagateAtLaunch': propagate,\n            })\n\n    def JSONrepr(self):\n        return self.tags\n\n\nclass NotificationConfiguration(AWSProperty):\n    props = {\n        'TopicARN': (basestring, True),\n        'NotificationTypes': (list, True),\n    }\n\n\nclass MetricsCollection(AWSProperty):\n    props = {\n        'Granularity': (basestring, True),\n        'Metrics': (list, False),\n    }\n\n\nclass Metadata(AWSHelperFn):\n    def __init__(self, init, authentication=None):\n        self.validate(init, authentication)\n        # get keys and values from init and authentication\n        # safe to use cause its always one key\n        initKey, initValue = init.data.popitem()\n        self.data = {initKey: initValue}\n        if authentication:\n            authKey, authValue = authentication.data.popitem()\n            self.data[authKey] = authValue\n\n    def validate(self, init, authentication):\n        if not isinstance(init, cloudformation.Init):\n            raise ValueError(\n                'init must be of type cloudformation.Init'\n            )\n\n        is_instance = isinstance(authentication, cloudformation.Authentication)\n        if authentication and not is_instance:\n            raise ValueError(\n                'authentication must be of type cloudformation.Authentication'\n            )\n\n    def JSONrepr(self):\n        return self.data\n\n\nclass AutoScalingGroup(AWSObject):\n    resource_type = \"AWS::AutoScaling::AutoScalingGroup\"\n\n    props = {\n        'AvailabilityZones': (list, True),\n        'Cooldown': (integer, False),\n        'DesiredCapacity': (integer, False),\n        'HealthCheckGracePeriod': (int, False),\n        'HealthCheckType': (basestring, False),\n        'InstanceId': (basestring, False),\n        'LaunchConfigurationName': (basestring, False),\n        'LoadBalancerNames': (list, False),\n        'MaxSize': (integer, True),\n        'MetricsCollection': ([MetricsCollection], False),\n        'MinSize': (integer, True),\n        'NotificationConfiguration': (NotificationConfiguration, False),\n        'PlacementGroup': (basestring, False),\n        'Tags': (list, False),  # Although docs say these are required\n        'TerminationPolicies': ([basestring], False),\n        'VPCZoneIdentifier': (list, False),\n    }\n\n    def validate(self):\n        if 'UpdatePolicy' in self.resource:\n            update_policy = self.resource['UpdatePolicy']\n\n            isMinRef = isinstance(update_policy.MinInstancesInService, Ref)\n            isMaxRef = isinstance(self.MaxSize, Ref)\n\n            if not (isMinRef or isMaxRef):\n                minCount = int(update_policy.MinInstancesInService)\n                maxCount = int(self.MaxSize)\n\n                if minCount >= maxCount:\n                    raise ValueError(\n                        \"The UpdatePolicy attribute \"\n                        \"MinInstancesInService must be less than the \"\n                        \"autoscaling group's MaxSize\")\n        launch_config = self.properties.get('LaunchConfigurationName')\n        instance_id = self.properties.get('InstanceId')\n        if launch_config and instance_id:\n            raise ValueError(\"LaunchConfigurationName and InstanceId \"\n                             \"are mutually exclusive.\")\n        if not launch_config and not instance_id:\n            raise ValueError(\"Must specify either LaunchConfigurationName or \"\n                             \"InstanceId: http://docs.aws.amazon.com/AWSCloud\"\n                             \"Formation/latest/UserGuide/aws-properties-as-gr\"\n                             \"oup.html#cfn-as-group-instanceid\")\n        return True\n\n\nclass LaunchConfiguration(AWSObject):\n    resource_type = \"AWS::AutoScaling::LaunchConfiguration\"\n\n    props = {\n        'AssociatePublicIpAddress': (boolean, False),\n        'BlockDeviceMappings': (list, False),\n        'EbsOptimized': (boolean, False),\n        'IamInstanceProfile': (basestring, False),\n        'ImageId': (basestring, True),\n        'InstanceId': (basestring, False),\n        'InstanceMonitoring': (boolean, False),\n        'InstanceType': (basestring, True),\n        'KernelId': (basestring, False),\n        'KeyName': (basestring, False),\n        'Metadata': (Metadata, False),\n        'RamDiskId': (basestring, False),\n        'SecurityGroups': (list, False),\n        'SpotPrice': (basestring, False),\n        'UserData': (basestring, False),\n    }\n\n\nclass ScalingPolicy(AWSObject):\n    resource_type = \"AWS::AutoScaling::ScalingPolicy\"\n\n    props = {\n        'AdjustmentType': (basestring, True),\n        'AutoScalingGroupName': (basestring, True),\n        'Cooldown': (integer, False),\n        'ScalingAdjustment': (basestring, True),\n    }\n\n\nclass ScheduledAction(AWSObject):\n    resource_type = \"AWS::AutoScaling::ScheduledAction\"\n\n    props = {\n        'AutoScalingGroupName': (basestring, True),\n        'DesiredCapacity': (integer, False),\n        'EndTime': (basestring, True),\n        'MaxSize': (integer, False),\n        'MinSize': (integer, False),\n        'Recurrence': (basestring, True),\n        'StartTime': (basestring, True),\n    }\n\n\nclass Trigger(AWSObject):\n    resource_type = \"AWS::AutoScaling::Trigger\"\n\n    props = {\n        'AutoScalingGroupName': (basestring, True),\n        'BreachDuration': (integer, True),\n        'Dimensions': (list, True),\n        'LowerBreachScaleIncrement': (integer, False),\n        'LowerThreshold': (integer, True),\n        'MetricName': (basestring, True),\n        'Namespace': (basestring, True),\n        'Period': (integer, True),\n        'Statistic': (basestring, True),\n        'Unit': (basestring, False),\n        'UpperBreachScaleIncrement': (integer, False),\n        'UpperThreshold': (integer, True),\n    }\n\n\nclass EBSBlockDevice(AWSProperty):\n    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-template.html\n    props = {\n        'DeleteOnTermination': (boolean, False),\n        'Iops': (integer, False),\n        'SnapshotId': (basestring, False),\n        'VolumeSize': (integer, False),\n        'VolumeType': (basestring, False),\n    }\n\n\nclass BlockDeviceMapping(AWSProperty):\n    # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-launchconfig-blockdev-mapping.html\n    props = {\n        'DeviceName': (basestring, True),\n        'Ebs': (EBSBlockDevice, False),\n        'NoDevice': (boolean, False),\n        'VirtualName': (basestring, False),\n    }\n", "path": "troposphere/autoscaling.py"}]}