aws kms list-keys
Gets a list of all KMS keys in the caller's Amazon Web Services account and Region. AWS CLI reference
1 example 2 options Its page in the AWS CLI reference
Examples
To get the KMS keys in an account and Region
The following list-keys example gets the KMS keys in an account and Region. This command returns both AWS managed keys and customer managed keys.
aws kms list-keysIdentifyIts output
{
"Keys": [
{
"KeyArn": "arn:aws:kms:us-west-2:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
"KeyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
},
{
"KeyArn": "arn:aws:kms:us-west-2:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
"KeyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
},
{
"KeyArn": "arn:aws:kms:us-west-2:123456789012:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
"KeyId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
}
]
}For more information, see Viewing Keys in the AWS Key Management Service Developer Guide.
Options
--limitUse this parameter to specify the maximum number of items to return.--markerUse this parameter in a subsequent request after you receive a response with truncated results.