retire_grant¶
Operation¶
retire_grant
async
¶
retire_grant(request: RetireGrantInput | RetireGrantInputDict, /, *, plugins: list[Plugin] | None = None) -> RetireGrantOutput
retire_grant(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[RetireGrantInputDict]) -> RetireGrantOutput
Deletes a grant. Typically, you retire a grant when you no longer need its permissions. To identify the grant to retire, use a grant token, or both the grant ID and a key identifier (key ID or key ARN) of the KMS key. The CreateGrant operation returns both values.
This operation can be called by the retiring principal for a grant, by
the grantee principal if the grant allows the RetireGrant operation,
and by the Amazon Web Services account in which the grant is created. It
can also be called by principals to whom permission for retiring a grant
is delegated.
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.
Cross-account use: Yes. You can retire a grant on a KMS key in a different Amazon Web Services account.
Required permissions: Permission to retire a grant is determined primarily by the grant. For details, see Retiring and revoking grants in the Key Management Service Developer Guide.
Related operations:
-
CreateGrant
-
ListGrants
-
ListRetirableGrants
-
RevokeGrant
Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
RetireGrantOutput
|
An instance of |
Input¶
Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.
Model¶
RetireGrantInput
dataclass
¶
Bases: _SerdeShape
Dataclass for RetireGrantInput structure.
Attributes¶
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | None = ...
Checks if your request will succeed. DryRun is an optional parameter.
To learn more about how to use this parameter, see Testing your permissions in the Key Management Service Developer Guide.
grant_id
class-attribute
instance-attribute
¶
grant_id: str | None = ...
Identifies the grant to retire. To get the grant ID, use CreateGrant, ListGrants, or ListRetirableGrants.
- Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123
grant_token
class-attribute
instance-attribute
¶
grant_token: str | None = ...
Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.
Only the CreateGrant operation returns a grant token. For details, see Grant token and Eventual consistency in the Key Management Service Developer Guide.
Dictionaries¶
RetireGrantInputDict
¶
Bases: TypedDict
Dictionary form of RetireGrantInput.
Attributes¶
dry_run
instance-attribute
¶
dry_run: bool | None
Checks if your request will succeed. DryRun is an optional parameter.
To learn more about how to use this parameter, see Testing your permissions in the Key Management Service Developer Guide.
grant_id
instance-attribute
¶
grant_id: str | None
Identifies the grant to retire. To get the grant ID, use CreateGrant, ListGrants, or ListRetirableGrants.
- Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123
grant_token
instance-attribute
¶
grant_token: str | None
Identifies the grant to be retired. You can use a grant token to identify a new grant even before it has achieved eventual consistency.
Only the CreateGrant operation returns a grant token. For details, see Grant token and Eventual consistency in the Key Management Service Developer Guide.
Output¶
RetireGrantOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for RetireGrantOutput structure.