@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.343Z") @Stability(value=Stable) public interface KeyProps extends software.amazon.jsii.JsiiSerializable
Example:
import software.amazon.awscdk.services.kms.*;
Key encryptionKey = Key.Builder.create(this, "Key")
.enableKeyRotation(true)
.build();
Table table = Table.Builder.create(this, "MyTable")
.partitionKey(Attribute.builder().name("id").type(AttributeType.STRING).build())
.encryption(TableEncryption.CUSTOMER_MANAGED)
.encryptionKey(encryptionKey)
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
KeyProps.Builder
A builder for
KeyProps |
static class |
KeyProps.Jsii$Proxy
An implementation for
KeyProps |
| Modifier and Type | Method and Description |
|---|---|
static KeyProps.Builder |
builder() |
default List<IPrincipal> |
getAdmins()
A list of principals to add as key administrators to the key policy.
|
default String |
getAlias()
Initial alias to add to the key.
|
default String |
getDescription()
A description of the key.
|
default Boolean |
getEnabled()
Indicates whether the key is available for use.
|
default Boolean |
getEnableKeyRotation()
Indicates whether AWS KMS rotates the key.
|
default KeySpec |
getKeySpec()
The cryptographic configuration of the key.
|
default KeyUsage |
getKeyUsage()
The cryptographic operations for which the key can be used.
|
default Duration |
getPendingWindow()
Specifies the number of days in the waiting period before AWS KMS deletes a CMK that has been removed from a CloudFormation stack.
|
default PolicyDocument |
getPolicy()
Custom policy document to attach to the KMS key.
|
default RemovalPolicy |
getRemovalPolicy()
Whether the encryption key should be retained when it is removed from the Stack.
|
@Stability(value=Stable) @Nullable default List<IPrincipal> getAdmins()
Key administrators have permissions to manage the key (e.g., change permissions, revoke), but do not have permissions to use the key in cryptographic operations (e.g., encrypt, decrypt).
These principals will be added to the default key policy (if none specified), or to the specified policy (if provided).
Default: []
@Stability(value=Stable) @Nullable default String getAlias()
More aliases can be added later by calling addAlias.
Default: - No alias is added for the key.
@Stability(value=Stable) @Nullable default String getDescription()
Use a description that helps your users decide whether the key is appropriate for a particular task.
Default: - No description.
@Stability(value=Stable) @Nullable default Boolean getEnabled()
Default: - Key is enabled.
@Stability(value=Stable) @Nullable default Boolean getEnableKeyRotation()
Default: false
@Stability(value=Stable) @Nullable default KeySpec getKeySpec()
IMPORTANT: If you change this property of an existing key, the existing key is scheduled for deletion and a new key is created with the specified value.
Default: KeySpec.SYMMETRIC_DEFAULT
@Stability(value=Stable) @Nullable default KeyUsage getKeyUsage()
IMPORTANT: If you change this property of an existing key, the existing key is scheduled for deletion and a new key is created with the specified value.
Default: KeyUsage.ENCRYPT_DECRYPT
@Stability(value=Stable) @Nullable default Duration getPendingWindow()
When you remove a customer master key (CMK) from a CloudFormation stack, AWS KMS schedules the CMK for deletion and starts the mandatory waiting period. The PendingWindowInDays property determines the length of waiting period. During the waiting period, the key state of CMK is Pending Deletion, which prevents the CMK from being used in cryptographic operations. When the waiting period expires, AWS KMS permanently deletes the CMK.
Enter a value between 7 and 30 days.
Default: - 30 days
@Stability(value=Stable) @Nullable default PolicyDocument getPolicy()
NOTE - If the @aws-cdk/aws-kms:defaultKeyPolicies feature flag is set (the default for new projects),
this policy will override the default key policy and become the only key policy for the key. If the
feature flag is not set, this policy will be appended to the default key policy.
Default: - A policy document with permissions for the account root to administer the key will be created.
@Stability(value=Stable) @Nullable default RemovalPolicy getRemovalPolicy()
This is useful when one wants to retain access to data that was encrypted with a key that is being retired.
Default: RemovalPolicy.Retain
@Stability(value=Stable) static KeyProps.Builder builder()
KeyProps.Builder of KeyPropsCopyright © 2022. All rights reserved.