AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Alias

Defines a display name for a customer master key (CMK) in AWS Key Management Service (AWS KMS). Using an alias to refer to a key can help you simplify key management. For example, when rotating keys, you can just update the alias mapping instead of tracking and changing key IDs. For more information, see Working with Aliases in the AWS Key Management Service Developer Guide. You can also add an alias for a key by calling `key.addAlias(alias)`.

Import

import { Alias } from 'aws-cdk-lib/aws-kms';

Or use the module namespace:

import * as kms from 'aws-cdk-lib/aws-kms';
// kms.Alias

Properties

Configuration passed to the constructor as AliasProps.

aliasNameRequired
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.

targetKeyRequired
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.

removalPolicyOptional
RemovalPolicy

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

Default: - The alias will be deleted

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter