listKeyPolicies
inline suspend fun KmsClient.listKeyPolicies(crossinline block: ListKeyPoliciesRequest.Builder.() -> Unit): ListKeyPoliciesResponse
Gets the names of the key policies that are attached to a KMS key. This operation is designed to get policy names that you can use in a GetKeyPolicy operation. However, the only valid policy name is default
.
Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.
Required permissions: kms:ListKeyPolicies (key policy)
Related operations:
GetKeyPolicy
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Samples
fun main() {
//sampleStart
// The following example lists key policies for the specified KMS key.
val resp = kmsClient.listKeyPolicies {
keyId = "1234abcd-12ab-34cd-56ef-1234567890ab"
}
//sampleEnd
}