Module Values.CreateGrantResponseSource

Adds a grant to a KMS key. A grant is a policy instrument that allows Amazon Web Services principals to use KMS keys in cryptographic operations. It also can allow them to view a KMS key (DescribeKey) and create and manage grants. When authorizing access to a KMS key, grants are considered along with key policies and IAM policies. Grants are often used for temporary permissions because you can create one, use its permissions, and delete it without changing your key policies or IAM policies. 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. The CreateGrant operation returns a GrantToken and a GrantId. When you create, retire, or revoke a grant, there might be a brief delay, usually less than five minutes, until the grant is available throughout KMS. This state is known as eventual consistency. Once the grant has achieved eventual consistency, the grantee principal can use the permissions in the grant without identifying the grant. However, to use the permissions in the grant immediately, use the GrantToken that CreateGrant returns. For details, see Using a grant token in the Key Management Service Developer Guide . The CreateGrant operation also returns a GrantId. You can use the GrantId and a key identifier to identify the grant in the RetireGrant and RevokeGrant operations. To find the grant ID, use the ListGrants or ListRetirableGrants operations. The KMS key that you use for this operation must be in a compatible key state. For details, see Key states of KMS keys in the Key Management Service Developer Guide. 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:CreateGrant (key policy) Related operations: ListGrants ListRetirableGrants RetireGrant RevokeGrant Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.

Sourcetype nonrec t = {
  1. grantToken : GrantTokenType.t option;
    (*

    The grant token. Use a grant token when your permission to call this operation comes from a new grant that has not yet achieved eventual consistency. For more information, see Grant token and Using a grant token in the Key Management Service Developer Guide.

    *)
  2. grantId : GrantIdType.t option;
    (*

    The unique identifier for the grant. You can use the GrantId in a ListGrants, RetireGrant, or RevokeGrant operation.

    *)
}
Sourcetype nonrec error = [
  1. | `DependencyTimeoutException of DependencyTimeoutException.t
  2. | `DisabledException of DisabledException.t
  3. | `DryRunOperationException of DryRunOperationException.t
  4. | `InvalidArnException of InvalidArnException.t
  5. | `InvalidGrantTokenException of InvalidGrantTokenException.t
  6. | `KMSInternalException of KMSInternalException.t
  7. | `KMSInvalidStateException of KMSInvalidStateException.t
  8. | `LimitExceededException of LimitExceededException.t
  9. | `NotFoundException of NotFoundException.t
  10. | `Unknown_operation_error of string * string option
]
Sourceval make : ?grantToken:??? -> ?grantId:??? -> unit -> t
Sourceval error_of_json : string -> Yojson.Safe.t -> [> `DependencyTimeoutException of DependencyTimeoutException.t | `DisabledException of DisabledException.t | `DryRunOperationException of DryRunOperationException.t | `InvalidArnException of InvalidArnException.t | `InvalidGrantTokenException of InvalidGrantTokenException.t | `KMSInternalException of KMSInternalException.t | `KMSInvalidStateException of KMSInvalidStateException.t | `LimitExceededException of LimitExceededException.t | `NotFoundException of NotFoundException.t | `Unknown_operation_error of string * string option ]
Sourceval error_of_xml : string -> Awso.Xml.t -> [> `DependencyTimeoutException of DependencyTimeoutException.t | `DisabledException of DisabledException.t | `DryRunOperationException of DryRunOperationException.t | `InvalidArnException of InvalidArnException.t | `InvalidGrantTokenException of InvalidGrantTokenException.t | `KMSInternalException of KMSInternalException.t | `KMSInvalidStateException of KMSInvalidStateException.t | `LimitExceededException of LimitExceededException.t | `NotFoundException of NotFoundException.t | `Unknown_operation_error of string * string option ]
Sourceval error_to_json : error -> Yojson.Safe.t
Sourceval to_value : t -> [> `Structure of (string * [> `String of GrantTokenType.t ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t