| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Describes one or more of your key pairs.
KeyName.nOne or more key pair names.
Type: String
Default: Describes all key pairs you own, or only those otherwise specified.
Required: No
Filter.n.NameThe name of a filter. See the Supported Filters section for a list of supported filter names.
Type: String
Default: None
Required: No
Filter.n.Value.mA value for the filter. See the Supported Filters section for a list of supported values for each filter.
Type: String
Default: None
Required: No
You can specify filters so that the response includes information for only certain key pairs. For example, you can use a filter to specify that you're interested in key pairs whose names include the string Dave. You can specify multiple values for a filter. The response includes information for a key pair only if it matches at least one of the filter values that you specified.
You can specify multiple filters; for example, specify key pairs whose names include the string Dave and whose fingerprint is a specific value. The response includes information for a key pair only if it matches all the filters that you specified. If there's no match, no special message is returned, the response is simply empty.
You can use wildcards in a filter value. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. You can escape special characters using a backslash (\) before the character. For example, a value of \*amazon\?\\ searches for the literal string *amazon?\.
The following are the available filters.
fingerprintThe fingerprint of the key pair.
Type: String
key-nameThe name of the key pair.
Type: String
The following elements are returned in a
DescribeKeyPairsResponse element.
requestIdThe ID of the request.
Type: xsd:string
keySetA list of key pairs, each one wrapped in an item element.
This example describes the keypair with name gsg-keypair.
https://ec2.amazonaws.com/?Action=DescribeKeyPairs &KeyName.1=gsg-keypair &AUTHPARAMS
<DescribeKeyPairsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<keySet>
<item>
<keyName>gsg-keypair</keyName>
<keyFingerprint>
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
</keyFingerprint>
</item>
</keySet>
</DescribeKeyPairsResponse>This example filters the response to include only key pairs whose names include the string Dave.
https://ec2.amazonaws.com/?Action=DescribeKeyPairs &Filter.1.Name=key-name &Filter.1.Value.1=*Dave* &AUTHPARAMS