title: Why does ECS CloudFormation template create an EC2 Spot Fleet
body: <p>I created a cluster in ECS with basic settings, nothing specific about the configuration except that I am using 1 On Demand t2.micro EC2 instance for the cluster.</p>
  <p>I wanted to see what exactly was created and took a look at the <a href="https://gist.github.com/pahud/399f0931c68a9137f8d1113ed8c0d942" rel="nofollow noreferrer">CloudFormation template</a> the cluster created.</p>
  <p>I noticed in the template it has a configuration for EcsSpotFleet</p>
  <pre><code>EcsSpotFleet:
      Condition: CreateWithSpot
      Type: AWS::EC2::SpotFleet
      Properties:
        SpotFleetRequestConfigData:
          AllocationStrategy: !Ref SpotAllocationStrategy
          IamFleetRole: !Ref IamSpotFleetRoleArn
          TargetCapacity: !Ref AsgMaxSize
          SpotPrice: !If [ CreateWithSpotPrice, !Ref SpotPrice, !Ref 'AWS::NoValue' ]
          TerminateInstancesWithExpiration: true
          LaunchSpecifications: 
  ....
  </code></pre>
  <p><strong>I am wondering why is this created?</strong> Because I know the Cluster instances are created with ASG + LC. My only explanation is this fleet is used for running the CloudFormation stack. I cannot find an explanation to this in the documentation, not even sure if instances are needed for CloudFormation stack run.</p>
  <p>p.s. I am very new to AWS, also have very little knowledge on CloudFormation.</p>