enable_key¶
Operation¶
enable_key
¶
enable_key(request: EnableKeyInput | EnableKeyInputDict | None = None, /, *, 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 |
|---|---|---|---|
request
|
EnableKeyInput | EnableKeyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[EnableKeyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
EnableKeyOutput
|
An instance of |
enable_key
async
¶
enable_key(request: EnableKeyInput | EnableKeyInputDict | None = None, /, *, 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 |
|---|---|---|---|
request
|
EnableKeyInput | EnableKeyInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
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
|
**kwargs
|
Unpack[EnableKeyInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
EnableKeyOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
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.
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.
Output¶
EnableKeyOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for EnableKeyOutput structure.