Module Smaws_Client_KMS.ListGrants

Gets a list of all grants for the specified KMS key.

You must specify the KMS key in all requests. You can filter the grant list by grant ID, grantee principal, or grantee service principal.

For detailed information about grants, including grant terminology, see Grants in KMS in the Key Management Service Developer Guide. For examples of creating grants in several programming languages, see Use CreateGrant with an Amazon Web Services SDK or CLI.

When a grant is created with the GranteePrincipal field, the ListGrants response usually contains the user or role designated as the grantee principal in the grant. However, if the grantee principal is an Amazon Web Services service, the GranteePrincipal field contains an Amazon Web Services service principal, which might correspond to several different grantee principals, such as an IAM user, IAM role, or Amazon Web Services account.

When a grant is created with the GranteeServicePrincipal field, the ListGrants response always includes a GranteeServicePrincipal that indicates the grantee is actually an Amazon Web Services service principal.

Cross-account use: Yes. To perform this operation on a KMS key in a different Amazon Web Services account, specify the key ARN in the value of the KeyId parameter.

Required permissions: kms:ListGrants (key policy)

Related operations:

Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.

val error_to_string : [ Smaws_Lib.Protocols.AwsJson.error | `DependencyTimeoutException of Types.dependency_timeout_exception | `InvalidArnException of Types.invalid_arn_exception | `InvalidGrantIdException of Types.invalid_grant_id_exception | `InvalidMarkerException of Types.invalid_marker_exception | `KMSInternalException of Types.kms_internal_exception | `KMSInvalidStateException of Types.kms_invalid_state_exception | `NotFoundException of Types.not_found_exception ] -> string
val request : 'http_type Smaws_Lib.Context.t -> Types.list_grants_request -> (Types.list_grants_response, [> Smaws_Lib.Protocols.AwsJson.error | `DependencyTimeoutException of Types.dependency_timeout_exception | `InvalidArnException of Types.invalid_arn_exception | `InvalidGrantIdException of Types.invalid_grant_id_exception | `InvalidMarkerException of Types.invalid_marker_exception | `KMSInternalException of Types.kms_internal_exception | `KMSInvalidStateException of Types.kms_invalid_state_exception | `NotFoundException of Types.not_found_exception ]) Stdlib.result
val request_with_metadata : 'http_type Smaws_Lib.Context.t -> Types.list_grants_request -> (Types.list_grants_response Smaws_Lib.Response.t, [> Smaws_Lib.Protocols.AwsJson.error | `DependencyTimeoutException of Types.dependency_timeout_exception | `InvalidArnException of Types.invalid_arn_exception | `InvalidGrantIdException of Types.invalid_grant_id_exception | `InvalidMarkerException of Types.invalid_marker_exception | `KMSInternalException of Types.kms_internal_exception | `KMSInvalidStateException of Types.kms_invalid_state_exception | `NotFoundException of Types.not_found_exception ] * Smaws_Lib.Response.metadata) Stdlib.result