enable_key¶
Operation¶
enable_key
async
¶
enable_key(request: EnableKeyInput | EnableKeyInputDict, /, *, plugins: list[Plugin] | None = None) -> EnableKeyOutput
enable_key(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[EnableKeyInputDict]) -> EnableKeyOutput
Sets the key state of a KMS key to enabled. This allows you to use the KMS key for cryptographic 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: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.
Required permissions: kms:EnableKey (key policy)
Related operations: DisableKey
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 |
|---|---|
EnableKeyOutput
|
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¶
EnableKeyInput
dataclass
¶
Bases: _SerdeShape
Dataclass for EnableKeyInput structure.
Attributes¶
key_id
class-attribute
instance-attribute
¶
key_id: str | None = ...
Identifies the KMS key to enable.
Specify the key ID or key ARN of the KMS key.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
Dictionaries¶
EnableKeyInputDict
¶
Bases: TypedDict
Dictionary form of EnableKeyInput.
Attributes¶
key_id
instance-attribute
¶
Identifies the KMS key to enable.
Specify the key ID or key ARN of the KMS key.
For example:
-
Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab -
Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
Output¶
EnableKeyOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for EnableKeyOutput structure.