from . import AWSProperty, AWSAttribute, validate_pausetime
from .validators import positive_integer, integer, boolean


class AutoScalingRollingUpdate(AWSProperty):
    props = {
        'MaxBatchSize': (positive_integer, False),
        'MinInstancesInService': (integer, False),
        'MinSuccessfulInstancesPercent': (integer, False),
        'PauseTime': (validate_pausetime, False),
        'SuspendProcesses': ([basestring], False),
        'WaitOnResourceSignals': (boolean, False),
    }


class AutoScalingScheduledAction(AWSProperty):
    props = {
        'IgnoreUnmodifiedGroupSizeProperties': (boolean, False),
    }


class AutoScalingReplacingUpdate(AWSProperty):
    props = {
        'WillReplace': (boolean, False),
    }


class UpdatePolicy(AWSAttribute):
    props = {
        'AutoScalingRollingUpdate': (AutoScalingRollingUpdate, False),
        'AutoScalingScheduledAction': (AutoScalingScheduledAction, False),
        'AutoScalingReplacingUpdate': (AutoScalingReplacingUpdate, False),
    }


class ResourceSignal(AWSProperty):
    props = {
        'Count': (positive_integer, False),
        'Timeout': (validate_pausetime, False),
    }


class CreationPolicy(AWSAttribute):
    props = {
        'ResourceSignal': (ResourceSignal, True),
    }

troposphere/policies.py
from . import AWSProperty, AWSAttribute, validate_pausetime
from .validators import positive_integer, integer, boolean


class AutoScalingRollingUpdate(AWSProperty):
    props = {
        'MaxBatchSize': (positive_integer, False),
        'MinInstancesInService': (integer, False),
        'MinSuccessfulInstancesPercent': (integer, False),
        'PauseTime': (validate_pausetime, False),
        'SuspendProcesses': ([basestring], False),
        'WaitOnResourceSignals': (boolean, False),
    }


class AutoScalingScheduledAction(AWSProperty):
    props = {
        'IgnoreUnmodifiedGroupSizeProperties': (boolean, False),
    }


class AutoScalingReplacingUpdate(AWSProperty):
    props = {
        'WillReplace': (boolean, False),
    }


class UpdatePolicy(AWSAttribute):
    props = {
        'AutoScalingRollingUpdate': (AutoScalingRollingUpdate, False),
        'AutoScalingScheduledAction': (AutoScalingScheduledAction, False),
        'AutoScalingReplacingUpdate': (AutoScalingReplacingUpdate, False),
    }


class ResourceSignal(AWSProperty):
    props = {
        'Count': (positive_integer, False),
        'Timeout': (validate_pausetime, False),
    }


class AutoScalingCreationPolicy(AWSProperty):
    props = {
        'MinSuccessfulInstancesPercent': (integer, False),
    }


class CreationPolicy(AWSAttribute):
    props = {
        'AutoScalingCreationPolicy': (AutoScalingCreationPolicy, False),
        'ResourceSignal': (ResourceSignal, True),
    }

troposphere/policies.py
diff --git a/tests/test_policies.py b/tests/test_policies.py
index dfd5542de..af8bac7e6 100644
--- a/tests/test_policies.py
+++ b/tests/test_policies.py
@@ -4,6 +4,7 @@
 from troposphere import awsencode, Parameter, Ref
 from troposphere.autoscaling import AutoScalingGroup
 from troposphere.policies import CreationPolicy, ResourceSignal, UpdatePolicy
+from troposphere.policies import AutoScalingCreationPolicy
 from troposphere.policies import AutoScalingRollingUpdate
 
 
@@ -35,6 +36,37 @@ def test_json(self):
         self.assertEqual(p['ResourceSignal']['Count'], 2)
         self.assertEqual(p['ResourceSignal']['Timeout'], 'PT10M')
 
+    def test_auto_scaling_creation_policy(self):
+        policy = CreationPolicy(
+            AutoScalingCreationPolicy=AutoScalingCreationPolicy(
+                MinSuccessfulInstancesPercent=50,
+            ),
+            ResourceSignal=ResourceSignal(
+                Count=2,
+                Timeout='PT10M'
+            )
+        )
+        self.assertEqual(
+            policy.AutoScalingCreationPolicy.MinSuccessfulInstancesPercent,
+            50
+        )
+
+    def test_auto_scaling_creation_policy_json(self):
+        policy = CreationPolicy(
+            AutoScalingCreationPolicy=AutoScalingCreationPolicy(
+                MinSuccessfulInstancesPercent=50,
+            ),
+            ResourceSignal=ResourceSignal(
+                Count=2,
+                Timeout='PT10M'
+            )
+        )
+        p = json.loads(json.dumps(policy, cls=awsencode))
+        self.assertEqual(
+            p['AutoScalingCreationPolicy']['MinSuccessfulInstancesPercent'],
+            50
+        )
+
 
 class TestUpdatePolicy(unittest.TestCase):
 
diff --git a/troposphere/policies.py b/troposphere/policies.py
index cfb5a4b91..af32850a9 100644
--- a/troposphere/policies.py
+++ b/troposphere/policies.py
@@ -40,7 +40,14 @@ class ResourceSignal(AWSProperty):
     }
 
 
+class AutoScalingCreationPolicy(AWSProperty):
+    props = {
+        'MinSuccessfulInstancesPercent': (integer, False),
+    }
+
+
 class CreationPolicy(AWSAttribute):
     props = {
+        'AutoScalingCreationPolicy': (AutoScalingCreationPolicy, False),
         'ResourceSignal': (ResourceSignal, True),
     }

Support AutoScalingCreationPolicy
From the docs, this is a top-level property of a [CreationPolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html#cfn-attributes-creationpolicy-properties). It is used for the [AutoScalingReplacingPolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html#cfn-attributes-updatepolicy-replacingupdate) to specify the MinSuccessfulInstancesPercent property.

The docs have a good example of this:

``` json
"UpdatePolicy" : {
  "AutoScalingReplacingUpdate" : {
    "WillReplace" : "true"
  },
"CreationPolicy" : {
  "ResourceSignal" : {
    "Count" : { "Ref" : "ResourceSignalsOnCreate"},
    "Timeout" : "PT10M"
  },
  "AutoScalingCreationPolicy" : {
    "MinSuccessfulInstancesPercent" : { "Ref" : "MinSuccessfulPercentParameter" }
  }
}
```

I might take a crack at this but I figured I'd file an issue first if only so that I can reference it.

