Skip to main content

EC2 Describe Key Pairs

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

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

External Documentation

To learn more, visit the AWS documentation.

Basic Parameters

ParameterDescription
AWS Region(s)Enter the desired AWS Region(s).

To execute the action in multiple regions, provide a comma-separated list.
For example: us-east-1,eu-west-2.

If you wish to run the action in all available regions, use the asterisk symbol (*) instead.
Key NamesThe key pair names.

Default: Describes all of your key pairs.

Advanced Parameters

ParameterDescription
Disable XML To JSON Auto ConvertWhen checked, XML responses are not automatically converted into JSON format.
Dry RunChecks 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.
FiltersThe filters.

- key-pair-id - The ID of the key pair.

- fingerprint - The fingerprint of the key pair.

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

- tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

- tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.
Key Pair IDsThe IDs of the key pairs.

Example Output

{
"KeyPairs": [
{
"KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f",
"KeyName": "my-key-pair"
}
]
}

Automation Library Example

Ec2 Describe Key Pairs with Aws and Send Results Via Email

Automation LibraryPreview this Automation on desktop