title: AWS Cloudformation Random Build Fail
body: <p>I'm using Cloudformation to automate instance creation. I'm using an auto scaling group to build a variable number dependent on what i need. However there is a reoccurring issue where at least 1 instance fails to run when i build 2+ instances from this script.</p>
  
  <p>For Example: I state 7 instances for cloudformation to build, 6 will work perfectly but there is always 1 that will not work. There is no error, it just seems to ignore commands. In the userdata section of this script i launch dockers to run in the instance. </p>
  
  <p>I get this error: <code>rpc error code = 13 desc = transport is closing</code></p>
  
  <p>Can someone take a look to see if doing something wrong or I'm missing a step?</p>
  
  <pre><code>     {
      "AWSTemplateFormatVersion": "2010-09-09",
      "Description": "Test",
      "Parameters": {
          "InstanceType": {
              "Type": "String",
              "Default": "t2.large"
          },
  
          "NoOfInstances": {
              "Type": "String",
              "ConstraintDescription": ""
          },
  
          "RoleName": {
              "Type": "String",
              "Default": "**",
              "ConstraintDescription": ""
          },
  
          "VPCParameter": {
              "Type": "AWS::EC2::VPC::Id",
              "Default": "**"
          },
  
          "SubnetsParameter": {
              "Type": "List&lt;AWS::EC2::Subnet::Id&gt;",
              "Default": "**"
          },
  
          "KeyName": {
              "Type": "AWS::EC2::KeyPair::KeyName",
              "Default": "**",
              "ConstraintDescription": ""
          }
      },
  
      "Mappings": {
          "AWSInstanceType2Arch": {
              "t2.large": {
                  "Arch": "HVM64"
              }
          },
  
          "AWSRegionArch2AMI": {
              "**": {
                  "HVM64": "**"
              }
          }
      },
  
      "Resources": {
  
          "LaunchConfig": {
              "Type": "AWS::AutoScaling::LaunchConfiguration",
              "Properties": {
                  "KeyName": {
                      "Ref": "KeyName"
                  },
                  "IamInstanceProfile": {
                      "Ref": "RoleName"
                  },
                  "SecurityGroups": [{
                      "Ref": "WebServerSecurityGroup"
                  }],
                  "ImageId": {
                      "Fn::FindInMap": ["AWSRegionArch2AMI",
                          {
                              "Ref": "AWS::Region"
                          }, {
                              "Fn::FindInMap": ["AWSInstanceType2Arch", {
                                  "Ref": "InstanceType"
                              }, "Arch"]
                          }
                      ]
                  },
  
                  "InstanceType": {
                      "Ref": "InstanceType"
                  },
                  "UserData": {
                      "Fn::Base64": {
                          "Fn::Join": ["", [ ** ]]
                      }
                  }
              }
          },
  
          "AutoScalingServerGroup": {
              "Type": "AWS::AutoScaling::AutoScalingGroup",
  
              "Properties": {
                  "LaunchConfigurationName": {
                      "Ref": "LaunchConfig"
                  },
                  "MinSize": "1",
                  "MaxSize": "30",
                  "Cooldown": "300",
                  "VPCZoneIdentifier": {
                      "Ref": "SubnetsParameter"
                  },
                  "DesiredCapacity": {
                      "Ref": "NoOfInstances"
                  },
                  "Tags": [ ** ]
              }
          },
  
          "WebServerSecurityGroup": {
              "Type": "AWS::EC2::SecurityGroup",
              "Properties": {
                  "GroupDescription": "**",
                  "VpcId": {
                      "Ref": "VPCParameter"
                  },
                  "SecurityGroupIngress": [{
                      "IpProtocol": "tcp",
                      "CidrIp": "**",
                      "FromPort": "**",
                      "ToPort": "**"
                  }, ]
              }
          },
  
          "WebServerScaleUpPolicy": {
              "Type": "AWS::AutoScaling::ScalingPolicy",
              "Properties": {
                  "AdjustmentType": "ChangeInCapacity",
                  "AutoScalingGroupName": {
                      "Ref": "AutoScalingServerGroup"
                  },
                  "Cooldown": "60",
                  "ScalingAdjustment": "1"
              }
          },
  
          "WebServerScaleDownPolicy": {
              "Type": "AWS::AutoScaling::ScalingPolicy",
              "Properties": {
                  "AdjustmentType": "ChangeInCapacity",
                  "AutoScalingGroupName": {
                      "Ref": "AutoScalingServerGroup"
                  },
                  "Cooldown": "60",
                  "ScalingAdjustment": "-1"
              }
          }
      }
    }
  </code></pre>