describe_key_pairs
¶
describe_key_pairs(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
28592 28593 28594 28595 28596 28597 28598 28599 28600 28601 28602 28603 28604 28605 28606 28607 28608 28609 28610 28611 28612 28613 28614 28615 28616 28617 28618 28619 28620 28621 28622 28623 28624 28625 28626 28627 28628 28629 28630 28631 28632 28633 28634 28635 28636 28637 28638 28639 28640 28641 28642 28643 28644 28645 28646 28647 28648 28649 28650 28651 28652 28653 28654 28655 28656 28657 28658 28659 28660 | |