title: Why won't CloudFormation execute my command?
body: <p>I'm using this CloudFormation script to create a Windows instance and install <a href="http://www.iis.net/downloads/microsoft/web-deploy" rel="nofollow">Web Deploy</a>:</p>
  
  <pre><code>{
    "AWSTemplateFormatVersion" : "2010-09-09",
  
    "Description" : "Test.",
  
    "Resources" : {
  
      "InstanceSecurityGroup" : {
        "Type" : "AWS::EC2::SecurityGroup",
        "Properties" : {
          "GroupDescription" : "Enable RDP",
          "SecurityGroupIngress" : [
            {"IpProtocol" : "tcp", "FromPort" : "3389", "ToPort" : "3389", "CidrIp" : "0.0.0.0/0"}
          ]
        }
      },
  
      "WindowsServer": {
        "Type" : "AWS::EC2::Instance",
        "Metadata" : {
          "AWS::CloudFormation::Init" : {
            "config" : {
              "files" : {
                "c:\\Packages\\WebDeploy_amd64_en-US.msi" : {
                  "source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi"
                }
              }
            },
            "commands" : {
              "1-installwebdeploy" : {
                "command" : "msiexec.exe /i c:\\Packages\\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart"
              }
            }
          }
        },
  
        "Properties": {
          "InstanceType" : "m1.small",
          "ImageId" : "ami-bbf2e1cf",
          "SecurityGroups" : [ {"Ref" : "InstanceSecurityGroup"} ],
          "KeyName" : "POP",
          "UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
              "&lt;script&gt;\n",
  
              "cfn-init.exe -v -s ", { "Ref" : "AWS::StackId" }, 
              " -r WindowsServer",
              " --region ", { "Ref" : "AWS::Region" }, "\n",
  
              "&lt;/script&gt;"
          ]]}}
        }
      }
    }
  }
  </code></pre>
  
  <p>The MSI package correctly downloads, but the command does not execute. In fact, the cfn-init.log states that no commands were specified:</p>
  
  <pre><code>2013-07-23 12:57:10,740 [DEBUG] CloudFormation client initialized with endpoint https://cloudformation.eu-west-1.amazonaws.com
  2013-07-23 12:57:10,740 [DEBUG] Describing resource WindowsServer in stack ***
  2013-07-23 12:57:14,079 [DEBUG] Creating Scheduled Task for cfn-init resume
  2013-07-23 12:57:14,220 [DEBUG] Scheduled Task created
  2013-07-23 12:57:14,328 [INFO] Running configSets: default
  2013-07-23 12:57:14,328 [INFO] Running configSet default
  2013-07-23 12:57:14,328 [INFO] Running config config
  2013-07-23 12:57:14,328 [DEBUG] No packages specified
  2013-07-23 12:57:14,328 [DEBUG] No groups specified
  2013-07-23 12:57:14,328 [DEBUG] No users specified
  2013-07-23 12:57:14,328 [DEBUG] No sources specified
  2013-07-23 12:57:14,328 [DEBUG] Parent directory c:\Packages does not exist, creating
  2013-07-23 12:57:14,328 [DEBUG] Writing content to c:\Packages\WebDeploy_amd64_en-US.msi
  2013-07-23 12:57:14,328 [DEBUG] Retrieving contents from http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi
  2013-07-23 12:57:14,673 [DEBUG] No mode specified for c:\Packages\WebDeploy_amd64_en-US.msi
  2013-07-23 12:57:14,673 [WARNING] Unsupported OS for setting owner/group: nt
  2013-07-23 12:57:14,673 [DEBUG] No commands specified
  2013-07-23 12:57:14,673 [DEBUG] No services specified
  2013-07-23 12:57:14,673 [INFO] ConfigSets completed
  2013-07-23 12:57:14,734 [DEBUG] Deleting Scheduled Task for cfn-init resume
  2013-07-23 12:57:14,796 [DEBUG] Scheduled Task deleted
  </code></pre>
  
  <p>What exactly is going on here? Thanks in advance.</p>