Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]



Describes the specified key pairs or all of your key pairs.

For more information about key pairs, see Key Pairs in the Amazon Elastic Compute Cloud User Guide .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


[--filters <value>]
[--key-names <value>]
[--dry-run | --no-dry-run]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--filters (list)

The filters.

  • fingerprint - The fingerprint of the key pair.
  • key-name - The name of the key pair.

Shorthand Syntax:

Name=string,Values=string,string ...

JSON Syntax:

    "Name": "string",
    "Values": ["string", ...]

--key-names (list)

The key pair names.

Default: Describes all your key pairs.


"string" "string" ...

--dry-run | --no-dry-run (boolean)

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation . Otherwise, it is UnauthorizedOperation .

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To display a key pair

This example displays the fingerprint for the key pair named MyKeyPair.


aws ec2 describe-key-pairs --key-name MyKeyPair


    "KeyPairs": [
            "KeyName": "MyKeyPair",
            "KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f"

For more information, see Using Key Pairs in the AWS Command Line Interface User Guide.


KeyPairs -> (list)

Information about the key pairs.


Describes a key pair.

KeyFingerprint -> (string)

If you used CreateKeyPair to create the key pair, this is the SHA-1 digest of the DER encoded private key. If you used ImportKeyPair to provide AWS the public key, this is the MD5 public key fingerprint as specified in section 4 of RFC4716.

KeyName -> (string)

The name of the key pair.