@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.318Z") @Stability(value=Stable) public class CfnKey extends CfnResource implements IInspectable
The AWS::KMS::Key resource specifies an KMS key in AWS Key Management Service . You can use this resource to create symmetric encryption KMS keys, asymmetric KMS keys for encryption or signing, and symmetric HMAC KMS keys. You can use AWS::KMS::Key to create multi-Region primary keys of all supported types. To replicate a multi-Region key, use the AWS::KMS::ReplicaKey resource.
You cannot use the AWS::KMS::Key resource to specify a KMS key with imported key material or a KMS key in a custom key store .
AWS KMS replaced the term customer master key (CMK) with AWS KMS key and KMS key . The concept has not changed. To prevent breaking changes, AWS KMS is keeping some variations of this term.
You can use symmetric encryption KMS keys to encrypt and decrypt small amounts of data, but they are more commonly used to generate data keys and data key pairs. You can also use a symmetric encryption KMS key to encrypt data stored in AWS services that are integrated with AWS KMS . For more information, see Symmetric encryption KMS keys in the AWS Key Management Service Developer Guide .
You can use asymmetric KMS keys to encrypt and decrypt data or sign messages and verify signatures. To create an asymmetric key, you must specify an asymmetric KeySpec value and a KeyUsage value. For details, see Asymmetric keys in AWS KMS in the AWS Key Management Service Developer Guide .
You can use HMAC KMS keys (which are also symmetric keys) to generate and verify hash-based message authentication codes. To create an HMAC key, you must specify an HMAC KeySpec value and a KeyUsage value of GENERATE_VERIFY_MAC . For details, see HMAC keys in AWS KMS in the AWS Key Management Service Developer Guide .
You can also create symmetric encryption, asymmetric, and HMAC multi-Region primary keys. To create a multi-Region primary key, set the MultiRegion property to true . For information about multi-Region keys, see Multi-Region keys in AWS KMS in the AWS Key Management Service Developer Guide .
If you change the value of the
KeyUsage,KeySpec, orMultiRegionproperty on an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specified value.While scheduled for deletion, the existing KMS key becomes unusable. If you don't cancel the scheduled deletion of the existing KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
Regions
AWS KMS CloudFormation resources are supported in all Regions in which AWS CloudFormation is supported. However, in the (ap-southeast-3), you cannot use a CloudFormation template to create or manage asymmetric KMS keys or multi-Region KMS keys (primary or replica).
Example:
CfnInclude cfnTemplate;
CfnKey cfnKey = (CfnKey)cfnTemplate.getResource("Key");
IKey key = Key.fromCfnKey(cfnKey);
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnKey.Builder
A fluent builder for
CfnKey. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnKey(software.constructs.Construct scope,
String id,
CfnKeyProps props)
Create a new `AWS::KMS::Key`.
|
protected |
CfnKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnKey(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The Amazon Resource Name (ARN) of the KMS key, such as `arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab` .
|
String |
getAttrKeyId()
The key ID of the KMS key, such as `1234abcd-12ab-34cd-56ef-1234567890ab` .
|
protected Map<String,Object> |
getCfnProperties() |
String |
getDescription()
A description of the KMS key.
|
Object |
getEnabled()
Specifies whether the KMS key is enabled.
|
Object |
getEnableKeyRotation()
Enables automatic rotation of the key material for the specified KMS key.
|
Object |
getKeyPolicy()
The key policy that authorizes use of the KMS key.
|
String |
getKeySpec()
Specifies the type of KMS key to create.
|
String |
getKeyUsage()
Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key.
|
Object |
getMultiRegion()
Creates a multi-Region primary key that you can replicate in other AWS Regions .
|
Number |
getPendingWindowInDays()
Specifies the number of days in the waiting period before AWS KMS deletes a KMS key that has been removed from a CloudFormation stack.
|
TagManager |
getTags()
Assigns one or more tags to the replica key.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setDescription(String value)
A description of the KMS key.
|
void |
setEnabled(Boolean value)
Specifies whether the KMS key is enabled.
|
void |
setEnabled(IResolvable value)
Specifies whether the KMS key is enabled.
|
void |
setEnableKeyRotation(Boolean value)
Enables automatic rotation of the key material for the specified KMS key.
|
void |
setEnableKeyRotation(IResolvable value)
Enables automatic rotation of the key material for the specified KMS key.
|
void |
setKeyPolicy(Object value)
The key policy that authorizes use of the KMS key.
|
void |
setKeySpec(String value)
Specifies the type of KMS key to create.
|
void |
setKeyUsage(String value)
Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key.
|
void |
setMultiRegion(Boolean value)
Creates a multi-Region primary key that you can replicate in other AWS Regions .
|
void |
setMultiRegion(IResolvable value)
Creates a multi-Region primary key that you can replicate in other AWS Regions .
|
void |
setPendingWindowInDays(Number value)
Specifies the number of days in the waiting period before AWS KMS deletes a KMS key that has been removed from a CloudFormation stack.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnKey(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnKey(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnKey(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnKeyProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
For information about the key ARN of a KMS key, see Key ARN in the AWS Key Management Service Developer Guide .
@Stability(value=Stable) @NotNull public String getAttrKeyId()
For information about the key ID of a KMS key, see Key ID in the AWS Key Management Service Developer Guide .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
Tagging or untagging a KMS key can allow or deny permission to the KMS key. For details, see ABAC for AWS KMS in the AWS Key Management Service Developer Guide .
For information about tags in AWS KMS , see Tagging keys in the AWS Key Management Service Developer Guide . For information about tags in CloudFormation, see Tag .
@Stability(value=Stable) @NotNull public Object getKeyPolicy()
If you are unsure of which policy to use, consider the default key policy . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see Default key policy in the AWS Key Management Service Developer Guide .
A key policy document can include only the following characters:
\ u0009 ), line feed ( \ u000A ), and carriage return ( \ u000D ) special characters
Minimum : 1
Maximum : 32768
@Stability(value=Stable)
public void setKeyPolicy(@NotNull
Object value)
If you are unsure of which policy to use, consider the default key policy . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see Default key policy in the AWS Key Management Service Developer Guide .
A key policy document can include only the following characters:
\ u0009 ), line feed ( \ u000A ), and carriage return ( \ u000D ) special characters
Minimum : 1
Maximum : 32768
@Stability(value=Stable) @Nullable public String getDescription()
Use a description that helps you to distinguish this KMS key from others in the account, such as its intended use.
@Stability(value=Stable)
public void setDescription(@Nullable
String value)
Use a description that helps you to distinguish this KMS key from others in the account, such as its intended use.
@Stability(value=Stable) @Nullable public Object getEnabled()
When Enabled is true , the key state of the KMS key is Enabled . When Enabled is false , the key state of the KMS key is Disabled . The default value is true .
The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the EnableKey , DisableKey , or ScheduleKeyDeletion operations.
For information about the key states of a KMS key, see Key state: Effect on your KMS key in the AWS Key Management Service Developer Guide .
@Stability(value=Stable)
public void setEnabled(@Nullable
Boolean value)
When Enabled is true , the key state of the KMS key is Enabled . When Enabled is false , the key state of the KMS key is Disabled . The default value is true .
The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the EnableKey , DisableKey , or ScheduleKeyDeletion operations.
For information about the key states of a KMS key, see Key state: Effect on your KMS key in the AWS Key Management Service Developer Guide .
@Stability(value=Stable)
public void setEnabled(@Nullable
IResolvable value)
When Enabled is true , the key state of the KMS key is Enabled . When Enabled is false , the key state of the KMS key is Disabled . The default value is true .
The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the EnableKey , DisableKey , or ScheduleKeyDeletion operations.
For information about the key states of a KMS key, see Key state: Effect on your KMS key in the AWS Key Management Service Developer Guide .
@Stability(value=Stable) @Nullable public Object getEnableKeyRotation()
By default, automatic key rotation is not enabled.
AWS KMS supports automatic rotation only for symmetric encryption KMS keys ( KeySpec = SYMMETRIC_DEFAULT ). For asymmetric KMS keys and HMAC KMS keys, omit the EnableKeyRotation property or set it to false .
To enable automatic key rotation of the key material for a multi-Region KMS key, set EnableKeyRotation to true on the primary key (created by using AWS::KMS::Key ). AWS KMS copies the rotation status to all replica keys. For details, see Rotating multi-Region keys in the AWS Key Management Service Developer Guide .
When you enable automatic rotation, AWS KMS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS KMS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see Rotating KMS keys in the AWS Key Management Service Developer Guide .
@Stability(value=Stable)
public void setEnableKeyRotation(@Nullable
Boolean value)
By default, automatic key rotation is not enabled.
AWS KMS supports automatic rotation only for symmetric encryption KMS keys ( KeySpec = SYMMETRIC_DEFAULT ). For asymmetric KMS keys and HMAC KMS keys, omit the EnableKeyRotation property or set it to false .
To enable automatic key rotation of the key material for a multi-Region KMS key, set EnableKeyRotation to true on the primary key (created by using AWS::KMS::Key ). AWS KMS copies the rotation status to all replica keys. For details, see Rotating multi-Region keys in the AWS Key Management Service Developer Guide .
When you enable automatic rotation, AWS KMS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS KMS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see Rotating KMS keys in the AWS Key Management Service Developer Guide .
@Stability(value=Stable)
public void setEnableKeyRotation(@Nullable
IResolvable value)
By default, automatic key rotation is not enabled.
AWS KMS supports automatic rotation only for symmetric encryption KMS keys ( KeySpec = SYMMETRIC_DEFAULT ). For asymmetric KMS keys and HMAC KMS keys, omit the EnableKeyRotation property or set it to false .
To enable automatic key rotation of the key material for a multi-Region KMS key, set EnableKeyRotation to true on the primary key (created by using AWS::KMS::Key ). AWS KMS copies the rotation status to all replica keys. For details, see Rotating multi-Region keys in the AWS Key Management Service Developer Guide .
When you enable automatic rotation, AWS KMS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS KMS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see Rotating KMS keys in the AWS Key Management Service Developer Guide .
@Stability(value=Stable) @Nullable public String getKeySpec()
The default value, SYMMETRIC_DEFAULT , creates a KMS key with a 256-bit symmetric key for encryption and decryption. You can't change the KeySpec value after the KMS key is created. For help choosing a key spec for your KMS key, see Choosing a KMS key type in the AWS Key Management Service Developer Guide .
The KeySpec property determines the type of key material in the KMS key and the algorithms that the KMS key supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM policy. For more information, see AWS KMS condition keys in the AWS Key Management Service Developer Guide .
If you change the
KeySpecvalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedKeySpecvalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted. > AWS services that are integrated with AWS KMS use symmetric encryption KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether a KMS key is asymmetric, see Identifying asymmetric KMS keys in the AWS Key Management Service Developer Guide .
AWS KMS supports the following key specs for KMS keys:
SYMMETRIC_DEFAULT (AES-256-GCM)HMAC_224HMAC_256HMAC_384HMAC_512RSA_2048RSA_3072RSA_4096ECC_NIST_P256 (secp256r1)ECC_NIST_P384 (secp384r1)ECC_NIST_P521 (secp521r1)ECC_SECG_P256K1 (secp256k1), commonly used for cryptocurrencies.@Stability(value=Stable)
public void setKeySpec(@Nullable
String value)
The default value, SYMMETRIC_DEFAULT , creates a KMS key with a 256-bit symmetric key for encryption and decryption. You can't change the KeySpec value after the KMS key is created. For help choosing a key spec for your KMS key, see Choosing a KMS key type in the AWS Key Management Service Developer Guide .
The KeySpec property determines the type of key material in the KMS key and the algorithms that the KMS key supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM policy. For more information, see AWS KMS condition keys in the AWS Key Management Service Developer Guide .
If you change the
KeySpecvalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedKeySpecvalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted. > AWS services that are integrated with AWS KMS use symmetric encryption KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether a KMS key is asymmetric, see Identifying asymmetric KMS keys in the AWS Key Management Service Developer Guide .
AWS KMS supports the following key specs for KMS keys:
SYMMETRIC_DEFAULT (AES-256-GCM)HMAC_224HMAC_256HMAC_384HMAC_512RSA_2048RSA_3072RSA_4096ECC_NIST_P256 (secp256r1)ECC_NIST_P384 (secp384r1)ECC_NIST_P521 (secp521r1)ECC_SECG_P256K1 (secp256k1), commonly used for cryptocurrencies.@Stability(value=Stable) @Nullable public String getKeyUsage()
If you change the
KeyUsagevalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedKeyUsagevalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
Select only one valid value.
ENCRYPT_DECRYPT .ENCRYPT_DECRYPT or SIGN_VERIFY .SIGN_VERIFY .GENERATE_VERIFY_MAC .@Stability(value=Stable)
public void setKeyUsage(@Nullable
String value)
If you change the
KeyUsagevalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedKeyUsagevalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
Select only one valid value.
ENCRYPT_DECRYPT .ENCRYPT_DECRYPT or SIGN_VERIFY .SIGN_VERIFY .GENERATE_VERIFY_MAC .@Stability(value=Stable) @Nullable public Object getMultiRegion()
You can't change the MultiRegion value after the KMS key is created.
If you change the
MultiRegionvalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedMulti-Regionvalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
For a multi-Region key, set to this property to true . For a single-Region key, omit this property or set it to false . The default value is false .
Multi-Region keys are an AWS KMS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see Multi-Region keys in the AWS Key Management Service Developer Guide .
You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store.
To create a replica of this primary key in a different AWS Region , create an AWS::KMS::ReplicaKey resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key.
@Stability(value=Stable)
public void setMultiRegion(@Nullable
Boolean value)
You can't change the MultiRegion value after the KMS key is created.
If you change the
MultiRegionvalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedMulti-Regionvalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
For a multi-Region key, set to this property to true . For a single-Region key, omit this property or set it to false . The default value is false .
Multi-Region keys are an AWS KMS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see Multi-Region keys in the AWS Key Management Service Developer Guide .
You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store.
To create a replica of this primary key in a different AWS Region , create an AWS::KMS::ReplicaKey resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key.
@Stability(value=Stable)
public void setMultiRegion(@Nullable
IResolvable value)
You can't change the MultiRegion value after the KMS key is created.
If you change the
MultiRegionvalue of an existing KMS key, the existing KMS key is scheduled for deletion and a new KMS key is created with the specifiedMulti-Regionvalue. While the scheduled deletion is pending, you can't use the existing KMS key. Unless you cancel the scheduled deletion of the KMS key outside of CloudFormation, all data encrypted under the existing KMS key becomes unrecoverable when the KMS key is deleted.
For a multi-Region key, set to this property to true . For a single-Region key, omit this property or set it to false . The default value is false .
Multi-Region keys are an AWS KMS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see Multi-Region keys in the AWS Key Management Service Developer Guide .
You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store.
To create a replica of this primary key in a different AWS Region , create an AWS::KMS::ReplicaKey resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key.
@Stability(value=Stable) @Nullable public Number getPendingWindowInDays()
Enter a value between 7 and 30 days. The default value is 30 days.
When you remove a KMS key from a CloudFormation stack, AWS KMS schedules the KMS key 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 KMS key is Pending Deletion or Pending Replica Deletion , which prevents the KMS key from being used in cryptographic operations. When the waiting period expires, AWS KMS permanently deletes the KMS key.
AWS KMS will not delete a multi-Region primary key that has replica keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to PendingReplicaDeletion so it cannot be replicated or used in cryptographic operations. This state can persist indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to PendingDeletion and the waiting period specified by PendingWindowInDays begins. When this waiting period expires, AWS KMS deletes the primary key. For details, see Deleting multi-Region keys in the AWS Key Management Service Developer Guide .
You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the AWS KMS console or the CancelKeyDeletion operation.
For information about the Pending Deletion and Pending Replica Deletion key states, see Key state: Effect on your KMS key in the AWS Key Management Service Developer Guide . For more information about deleting KMS keys, see the ScheduleKeyDeletion operation in the AWS Key Management Service API Reference and Deleting KMS keys in the AWS Key Management Service Developer Guide .
Minimum : 7
Maximum : 30
@Stability(value=Stable)
public void setPendingWindowInDays(@Nullable
Number value)
Enter a value between 7 and 30 days. The default value is 30 days.
When you remove a KMS key from a CloudFormation stack, AWS KMS schedules the KMS key 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 KMS key is Pending Deletion or Pending Replica Deletion , which prevents the KMS key from being used in cryptographic operations. When the waiting period expires, AWS KMS permanently deletes the KMS key.
AWS KMS will not delete a multi-Region primary key that has replica keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to PendingReplicaDeletion so it cannot be replicated or used in cryptographic operations. This state can persist indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to PendingDeletion and the waiting period specified by PendingWindowInDays begins. When this waiting period expires, AWS KMS deletes the primary key. For details, see Deleting multi-Region keys in the AWS Key Management Service Developer Guide .
You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the AWS KMS console or the CancelKeyDeletion operation.
For information about the Pending Deletion and Pending Replica Deletion key states, see Key state: Effect on your KMS key in the AWS Key Management Service Developer Guide . For more information about deleting KMS keys, see the ScheduleKeyDeletion operation in the AWS Key Management Service API Reference and Deleting KMS keys in the AWS Key Management Service Developer Guide .
Minimum : 7
Maximum : 30
Copyright © 2022. All rights reserved.