title: Why can't I get windows password from AWS?
body: <p>I launched a windows EC2 instance on AWS but I can't get the password for login. I keep getting this warning message even one day after launching the server. </p>
  
  <pre><code>Password not available yet.
  Please wait at least 4 minutes after launching an instance before trying to retrieve the auto-generated password.
  
  Note: Passwords are generated during the launch of Amazon Windows AMIs or custom AMIs that have been configured to enable this feature. Instances launched from a custom AMI without this feature enabled use the username and password of the AMI's parent instance.
  </code></pre>
  
  <p>And I also tried below command line:</p>
  
  <pre><code>$ aws --profile ie ec2 get-password-data --instance-id i-xxxxx --priv-launch-key my.pem  --region ap-southeast-2
  </code></pre>
  
  <p>but it returns an empty password:</p>
  
  <pre><code>{
      "InstanceId": "i-xxxx",
      "PasswordData": "",
      "Timestamp": "2019-08-05T23:12:04.000Z"
  }
  </code></pre>
  
  <p>So how can I get the password for this EC2 instance?
  I have tried to stop/start the instance but it doesn't help.</p>
  
  <p>One possible reason is that the instance is launched from a customised AMI but I also don't know that AMI's password. Is there a way to reset the password?</p>