AWS SDK for Python - Boto - KeyPair Creation Confusion
<p>I am trying to create a EC2 key-pair using the create_key_pair() method, something like:</p>

<pre><code>key_name = 'BlockChainEC2InstanceKeyPair-1'    
def create_new_key_pair(key_name):
    newKey = objEC2.create_key_pair(key_name)
    newKey.save(dir_to_save_new_key)
</code></pre>

<p>The keys are created as I can fetch these using the get_all_key_pairs() method like below:</p>

<pre><code>def get_all_keypairs():
    try:
         key= objEC2.get_all_key_pairs()
    except:
        raise
</code></pre>

<p>get_all_key_pairs() returns the result like below showing that the keypair exists:</p>

<pre><code>&lt;DescribeKeyPairsResponse xmlns="http://ec2.amazonaws.com/doc/2014-10-01/"&gt;
    &lt;requestId&gt;8d3faa7d-70c2-4b7c-ad18-810f23230c22&lt;/requestId&gt;
    &lt;keySet&gt;
        &lt;item&gt;
            &lt;keyName&gt;BlockChainEC2InstanceKeyPair-1&lt;/keyName&gt;
            &lt;keyFingerprint&gt;30:51:d4:19:a5:ba:11:dc:7e:9d:ca:49:10:01:30:34:b5:7e:9b:8a&lt;/keyFingerprint&gt;
        &lt;/item&gt;
        &lt;item&gt;
            &lt;keyName&gt;BlockChainEC2InstanceKeyPair-1.pem&lt;/keyName&gt;
            &lt;keyFingerprint&gt;18:7e:ba:2c:44:67:44:a7:06:c4:68:3a:47:00:88:8f:31:98:27:e6&lt;/keyFingerprint&gt;
        &lt;/item&gt;
    &lt;/keySet&gt;
&lt;/DescribeKeyPairsResponse&gt;
</code></pre>

<p>My problem is when I log into my AWS console for the same account whose access keys I used to create the keypairs - I don't get to find the keys.</p>

<p><strong>Question is</strong>: Where in my AWS console can I see the key-pair I created using the create_key_pair() method.</p>

<p>The <code>keypairs</code> are for each region. I suspect you are creating the keypair in one region using boto and you are checking for the keypair in a different region in your AWS console.</p>

<p>Make sure you default region in boto ( .aws/config ) and check your AWS dashboard is in the same region. If not change the region in the dashboard to match your boto default region and your keypair will appear there.</p>

<p>Or pass the region parameter when creating the EC2 object.</p>

python amazon-web-services amazon-ec2 boto