title: How to create EC2 instance by docker-machine with exists key pair?
body: <p>Use this way to create an instance on aws:</p>
  
  <pre><code>docker-machine create \
    -d amazonec2 \
    --amazonec2-region ap-northeast-1 \
    --amazonec2-zone a \
    --amazonec2-ami ami-XXXXXX \
    --amazonec2-keypair-name my_key_pair \
    --amazonec2-ssh-keypath ~/.ssh/id_rsa \
    my_instance
  </code></pre>
  
  <p>Can't connect to it by ssh.</p>
  
  <p>The <code>my_key_pare</code> is a name that exist on aws. The <code>~/.ssh/id_rsa</code> is local ssh private key. How to set the right value?</p>
  
  <p>I have read the <a href="https://docs.docker.com/machine/drivers/aws/#options" rel="nofollow noreferrer">document</a> but didn't find an example of using both <code>--amazonec2-keypair-name</code> and <code>--amazonec2-ssh-keypath</code>.</p>