Gets a list of all KMS keys in the caller's Amazon Web Services account and Region.
You can also use
ListKeys to list KMS keys in the Region that other Amazon Web Services accounts shared with the caller's Amazon Web Services account through Resource Access Manager (RAM). To list them, use the
ResourceOwners parameter. If you omit
ResourceOwners,
ListKeys lists only the KMS keys in the caller's Amazon Web Services account.
When
ResourceOwners includes
OTHER_ACCOUNTS_VIA_RAM,
ListKeys returns the KMS keys that other Amazon Web Services accounts currently share with the caller's Amazon Web Services account through RAM. For information about how and when a resource that another account shares becomes available to your Amazon Web Services account, see
Access Amazon Web Services resources shared with you in the
RAM User Guide.
Cross-account use: No. This operation doesn't take a KMS key parameter, so you can't use it to list the KMS keys of a specific Amazon Web Services account. The only KMS keys in other Amazon Web Services accounts that
ListKeys returns are the ones that other accounts shared with the caller's Amazon Web Services account through RAM. To list them, set the
ResourceOwners parameter to include
OTHER_ACCOUNTS_VIA_RAM.
Required permissions:
kms:ListKeys (IAM policy)
The same
kms:ListKeys permission lets you list the KMS keys that other accounts shared with you through RAM. KMS doesn't evaluate the key policies of shared KMS keys when it lists them. To use a shared KMS key, you need permission for each operation on that KMS key.
Related operations:Eventual consistency: The KMS API follows an eventual consistency model. For more information, see
KMS eventual consistency.
KMS keys that other Amazon Web Services accounts share with you can take some time to appear in or disappear from
ListKeys results after changes to resource shares, such as accepting an invitation or deleting a resource share.
This cmdlet automatically pages all available results to the pipeline - parameters related to iteration are only needed if you want to manually control the paginated output. To disable autopagination, use -NoAutoIteration.
Note: For scripts written against earlier versions of this module this cmdlet can also be invoked with the alias,
Get-KMSKeys.