title: How to self terminate EC2 from powershell?
body: <p>I need powershell code to terminate an instance without hardcoding the instance ID. </p>
  
  <p>I tried </p>
  
  <pre class="lang-bsh prettyprint-override"><code>aws ec2 terminate-instances --instance-ids 'curl http://169.254.169.254/latest/meta-data/instance-id'
  </code></pre>
  
  <p>But the instance doesn't terminate. Any ideas? </p>