title: Amazon EC2 custom AMI not running bootstrap (user-data)
body: <p>I have encountered an issue when creating custom AMIs (images) on EC2 instances. If I start up a Windows default 2012 server instance with a custom bootstrap/user-data script such as;</p>
  
  <pre><code>&lt;powershell&gt;
  PowerShell "(New-Object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe','C:\vcredist_x64.exe')"
  &lt;/powershell&gt;
  </code></pre>
  
  <p>It will work as intended and go to the URL and download the file, and store it on the C: Drive.</p>
  
  <p>But if I setup a Windows Server Instance, then create a image from it, and store it as a Custom AMI, then deploy it with the exact same custom user-data script it will not work. But if I go to the instance url (<code>http://169.254.169.254/latest/user-data</code>) it will show the script has imported successfully but has not been executed.</p>
  
  <p>After checking the error logs I have noticed this on a regular occasion: </p>
  
  <pre><code>Failed to fetch instance metadata http://169.254.169.254/latest/user-data with exception The remote server returned an error: (404) Not Found.
  </code></pre>