aws-cdk-lib.aws_kms.AliasProps

interface AliasProps

LanguageType name
.NETAmazon.CDK.AWS.KMS.AliasProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awskms#AliasProps
Javasoftware.amazon.awscdk.services.kms.AliasProps
Pythonaws_cdk.aws_kms.AliasProps
TypeScript (source)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

NameTypeDescription
aliasNamestringThe name of the alias.
targetKeyIKeyThe ID of the key for which you are creating the alias.
removalPolicy?RemovalPolicyPolicy 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: RemovalPolicy (optional, default: The alias will be deleted)

Policy to apply when the alias is removed from this stack.