describe_key_pairs
async
¶
describe_key_pairs(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
key_names: Optional[KeyNameStringList] = None,
key_pair_ids: Optional[KeyPairIdStringList] = None,
include_public_key: Optional[Boolean] = None,
dry_run: Optional[Boolean] = None,
filters: Optional[FilterList] = None,
) -> DescribeKeyPairsResult
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 EC2 User Guide.
Parameters:
-
key_names(Optional[KeyNameStringList], default:None) –The key pair names.
Default: Describes all of your key pairs.
-
key_pair_ids(Optional[KeyPairIdStringList], default:None) –The IDs of the key pairs.
-
include_public_key(Optional[Boolean], default:None) –If
true, the public key material is included in the response.Default:
false -
dry_run(Optional[Boolean], default:None) –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 isUnauthorizedOperation. -
filters(Optional[FilterList], default:None) –The 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:- 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 Ownerand the valueTeamA, specifytag:Ownerfor the filter name andTeamAfor the filter value.
-
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To display a key pair This example displays the fingerprint for the specified key.
Source code in docs_src/capo_ec2/_services/async_ec2.py
28985 28986 28987 28988 28989 28990 28991 28992 28993 28994 28995 28996 28997 28998 28999 29000 29001 29002 29003 29004 29005 29006 29007 29008 29009 29010 29011 29012 29013 29014 29015 29016 29017 29018 29019 29020 29021 29022 29023 29024 29025 29026 29027 29028 29029 29030 29031 29032 29033 29034 29035 29036 29037 29038 29039 29040 29041 29042 29043 29044 29045 29046 29047 29048 29049 29050 29051 29052 29053 29054 | |