interface AliasProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.KMS.AliasProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awskms#AliasProps |
![]() | software.amazon.awscdk.services.kms.AliasProps |
![]() | aws_cdk.aws_kms.AliasProps |
![]() | aws-cdk-lib » aws_kms » AliasProps |
Construction properties for a KMS Key Alias object.
Example
// Passing an encrypted replication bucket created in a different stack.
const app = new App();
const replicationStack = new Stack(app, 'ReplicationStack', {
env: {
region: 'us-west-1',
},
});
const key = new kms.Key(replicationStack, 'ReplicationKey');
const alias = new kms.Alias(replicationStack, 'ReplicationAlias', {
// aliasName is required
aliasName: PhysicalName.GENERATE_IF_NEEDED,
targetKey: key,
});
const replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', {
bucketName: PhysicalName.GENERATE_IF_NEEDED,
encryptionKey: alias,
});
Properties
Name | Type | Description |
---|---|---|
alias | string | The name of the alias. |
target | IKey | The ID of the key for which you are creating the alias. |
removal | Removal | Policy to apply when the alias is removed from this stack. |
aliasName
Type:
string
The name of the alias.
The name must start with alias followed by a forward slash, such as alias/. You can't specify aliases that begin with alias/AWS. These aliases are reserved.
targetKey
Type:
IKey
The ID of the key for which you are creating the alias.
Specify the key's globally unique identifier or Amazon Resource Name (ARN). You can't specify another alias.
removalPolicy?
Type:
Removal
(optional, default: The alias will be deleted)
Policy to apply when the alias is removed from this stack.