KeyProps Struct
Construction properties for a KMS Key object.
Example
const cmk = new kms.Key(this, 'cmk', {});
const claudeModel = bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_SONNET_V1_0;
const variant1 = bedrock.PromptVariant.text({
variantName: 'variant1',
model: claudeModel,
promptVariables: ['topic'],
promptText: 'This is my first text prompt. Please summarize our conversation on: {{topic}}.',
inferenceConfiguration: bedrock.PromptInferenceConfiguration.text({
temperature: 1.0,
topP: 0.999,
maxTokens: 2000,
}),
});
const prompt1 = new bedrock.Prompt(this, 'prompt1', {
promptName: 'prompt1',
description: 'my first prompt',
defaultVariant: variant1,
variants: [variant1],
kmsKey: cmk,
});
Properties
adminsIPrincipal[]adminstyping.List[IPrincipal]adminsList<IPrincipal>AdminsIPrincipal[]Admins*[]IPrincipal= []#notes
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).
More aliases can be added later by calling addAlias.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= No description.#Use a description that helps your users decide whether the key is appropriate for a particular task.
enableKeyRotationbooleanenable_key_rotationboolenableKeyRotationBooleanEnableKeyRotationboolEnableKeyRotation*bool= false#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.
keyUsageKeyUsagekey_usageKeyUsagekeyUsageKeyUsageKeyUsageKeyUsageKeyUsageKeyUsage= KeyUsage.ENCRYPT_DECRYPT#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.
notes
You can't change the multiRegion value after the KMS key is created.
IMPORTANT: If you change the value of the multiRegion property on an existing KMS key, the update request fails, regardless of the value of the UpdateReplacePolicy attribute. This prevents you from accidentally deleting a KMS key by changing an immutable property value.
pendingWindowDurationpending_windowDurationpendingWindowDurationPendingWindowDurationPendingWindowDuration= 30 days#notes
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.
policyPolicyDocumentpolicyPolicyDocumentpolicyPolicyDocumentPolicyPolicyDocumentPolicyPolicyDocument= A policy document with permissio…#notes · default
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.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.Retain#This is useful when one wants to retain access to data that was encrypted with a key that is being retired.